root:~ # ser_mysql.sh
usage: ser_mysql.sh create
ser_mysql.sh drop (!!entirely deletes tables)
ser_mysql.sh reinit (!!entirely deletes and than re-creates tables
ser_mysql.sh backup (dumps current database to stdout)
ser_mysql.sh restore
ser_mysql.sh copy
ser_mysql.sh reinstall (updates to a new SER database)
if you want to manipulate database as other MySql user than
root, want to change database name from default value "ser",
or want to use other values for users and password, edit the
"config vars" section of the command ser_mysql.sh
root:~ # ser_mysql.sh create
MySql password for root:cisco123
Domain (realm) for the default user 'admin' : admin
creating database ser ...
好啦,进去看看吧:
root:~ # mysql -u root -p
Enter password:cisco123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24 to server version: 5.0.26
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cyask |
| cyask0119 |
| mysql |
| ser |
| test |
| tmp |
| wikidb |
+--------------------+
8 rows in set (0.00 sec)
mysql> use ser;
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_ser |
+-----------------------+
| acc |
| active_sessions |
| admin_privileges |
| aliases |
| calls_forwarding |
| config |
| domain |
| event |
| grp |
| location |
| missed_calls |
| pending |
| phonebook |
| preferences_types |
| reserved |
| server_monitoring |
| server_monitoring_agg |
| silo |
| speed_dial |
| subscriber |
| trusted |
| uri |
| usr_preferences |
| version |
+-----------------------+
24 rows in set (0.00 sec)
再看看用户的列表:
mysql> select * from subscriber;
+----------------------------------+----------+--------+----------+------------+-----------+-------+----------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| phplib_id | username | domain | password | first_name | last_name | phone | email_address | datetime_created | datetime_modified | confirmation | flag | sendnotification | greeting | ha1 | ha1b | allow_find | timezone | rpid | domn | uuid |
+----------------------------------+----------+--------+----------+------------+-----------+-------+----------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| bfbd785b1447989599493a0c4ff0ed12 | admin | admin | heslo | Initial | Admin | 123 | root@localhost | 2002-09-04 19:37:45 | 0000-00-00 00:00:00 | 57DaSIPuCm52UNe54LF545750cfdL48OMZfroM53 | o | | | 381c06175d479f35e14ef1ab571006a9 | f11387e2a4644ebd23dcddc8296aff07 | 0 | NULL | NULL | NULL | NULL |
+----------------------------------+----------+--------+----------+------------+-----------+-------+----------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
1 row in set (0.00 sec)
呵呵,貌似只有一条吭,退出来再加俩用户:
root:~ #serctl add
eg: serctl add 1111 1111 1111@sipurash.com
domain unknown: use usernames with domain or set default domain in SIP_DOMAIN
报错!!!
这是个奇怪的BUG,解决办法是先设置好系统环境变量:
root:~ #export SIP_DOMAIN="sipurash.com"
root:~ #serctl add 1111 1111 1111@sipurash.com
Mysql password: heslo (记住喽,不是Mysql的root密码,是刚才数据库里看到的那个admin密码)
new user added
new user into uri table added
行了,再进Mysql里check一下,看是不是多出俩用户:
mysql> select * from subscriber;
+----------------------------------+----------+--------------+----------+------------+-----------+-------+-------------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| phplib_id | username | domain | password | first_name | last_name | phone | email_address | datetime_created | datetime_modified | confirmation | flag | sendnotification | greeting | ha1 | ha1b | allow_find | timezone | rpid | domn | uuid |
+----------------------------------+----------+--------------+----------+------------+-----------+-------+-------------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| 69c0a7786ca204e08df9574aa9a08b65 | admin | sipurash.com | heslo | Initial | Admin | 123 | root@localhost | 2002-09-04 19:37:45 | 0000-00-00 00:00:00 | 57DaSIPuCm52UNe54LF545750cfdL48OMZfroM53 | o | | | a04b52602361fc804ab28d279c47425e | 7ffcf5a0fe10951340094c14b5b37ee1 | 0 | NULL | NULL | NULL | NULL |
| 56e0357f4a1dc787ff1ffe02c35ee230 | 1111 | sipurash.com | 1111 | | | | 1111@sipurash.com | 2007-04-10 14:45:22 | 0000-00-00 00:00:00 | | o | | | 56e0357f4a1dc787ff1ffe02c35ee230 | 8cf011a6d9251fcada7dae0bfb12ba12 | 0 | NULL | NULL | NULL | NULL |
| 93235e3655d178cff742f09e47079bbf | 2222 | sipurash.com | 2222 | | | | 2222@sipurash.com | 2007-04-10 14:45:40 | 0000-00-00 00:00:00 | | o | | | 93235e3655d178cff742f09e47079bbf | 798f1476edd5f5ab1243fc184396fb9a | 0 | NULL | NULL | NULL | NULL |
| edbde0b2da045fce98ee3cbde5fa488b | 3333 | sipurash.com | 3333 | | | | 3333@sipurash.com | 2007-07-13 10:31:05 | 0000-00-00 00:00:00 | | o | | | edbde0b2da045fce98ee3cbde5fa488b | 70072d6c05b1c6b973ae3fed36e66ae4 | 0 | NULL | NULL | NULL | NULL |
+----------------------------------+----------+--------------+----------+------------+-----------+-------+-------------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
4 rows in set (0.00 sec)
0 comments:
Post a Comment