Ubuntu Install MYSQL

Source: Internet
Author: User

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:

    1. http://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97
    2. Http://www.cnblogs.com/wuhou/archive/2008/09/28/1301071.html
    3. Http://tech.sina.com.cn/s/s/2008-12-24/09322685698.shtml
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.