1. Install MySQL
sudo apt-get install Mysql-server
2. Modify the MySQL root user password
The root user does not have a password after the default MySQL installation, so first use the root user to enter:
$mysql-U root-p
Mysql>use MySQL; Update user set Password=password (' Panpan ') where user= ' root '; flush privileges;
Change Password to Panpan
3. Modify the MySQL root user remote access permission
First modify the configuration file sudo vim/etc/mysql/my.cnf
bind-address=127.0.0.1 = bind-address= The IP of your machine
Restart MySQL
Sudo/etc/init.d/mysql restart
Native Login Mysql:mysql-u root-p
Then enter the password Panpan
Use MySQL;
Grant all privileges in . to [email protected] '% ' identified by ' Panpan ' with grant Option;flush privileges;
Enter MySQL library to see if the data for% of host is added: use MySQL; select * from user;
This allows access to the login using Navicat 3306/192.168.1.21/root/panpan
4. Add new user Panyingyun and create database mame so that it can only access the MAME database
Native Login Mysql:mysql-u root-p
Mysql>create database mame;
Mysql>grant all privileges in mame.* to [email protected] '% ' identified by ' Panpan ' with grant Option;flush privileges;
This allows access to the login using Navicat 3306/192.168.1.21/panyingyun/panpan
Reference documents:
- http://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97
- Http://www.cnblogs.com/wuhou/archive/2008/09/28/1301071.html
- Http://tech.sina.com.cn/s/s/2008-12-24/09322685698.shtml