环境说明:
linux as5 mysql数据库主机 IP:192.168.1.1 root/123456
远程主机 windows xp IP:192.168.1.2
一.建立数据库
[root@mail /root]#mysql -u root -p < DATABASE_MYSQL.SQL(TXT)
二.连接查看数据库
[root@mail /root]#mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 5.0.22
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
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
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> GRANT ALL PRIVILEGES . *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES . *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql>flush privileges; (刷新系统表)
三.客户端登陆
![](https://i-blog.csdnimg.cn/blog_migrate/c88dc225fcfa05657c6e53f0b2e1e399.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/128635a0ca6fc0ca5e65e42e52e24906.jpeg)
转载于:https://blog.51cto.com/heyiyi/115772