#登录mysql数据库
mysql -u root -p
#创建tdcxl数据库
mysql> create database tdcxl;
mysql> use tdcxl;
mysql>source /home/cxl/tdcxl.sql
四、目标端创建用户并赋权
#创建用户
mysql> create user 'tdcxl'@'%' identified by 'tdcxl123';
Query OK, 0 rows affected (0.02 sec)#赋权,%代表可以通过外部客户端进行连接用户
mysql> grant all privileges on tdcxl.* to tdcxl@'%';
Query OK, 0 rows affected (0.00 sec)#刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
附:删除用户
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql>
mysql> delete from user where user='zabbix';
Query OK, 1 row affected (0.02 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)