Install MySQL on Ubuntu

Source: Internet
Author: User

1. Delete MySQL

1sudo apt-Get Autoremove--Purge MySQL-Server-5.0
2 sudo apt- get remove mysql- server
3 -get autoremove mysql-server
4 -get remove mysql-common (very important)

Suggest or execute it in order

Clean up residual data

dpkg -l | grep ^RC| awk '{print $}' | sudo xargs dpkg -P
2. Install MySQL
1 sudo apt -get install mysql- server
2 -get install mysql-client
3 -get install php5-mysql)
Once the installation is complete, the MySQL server should start automatically. You can check whether the MySQL server is running by running the following command at the terminal prompt:
1 sudo netstat -tap | grep mysql


When you run the command, you can see a line similar to the following:

TCP 0 0 Localhost.localdomain:mysql *:* LISTEN-

If the server does not function correctly, you can start it by using the following command:

1 sudo /etc/init.d/mysql restart

3. Enter MySQL

$mysql-uroot-p Administrator Password
To modify the administrator password for MySQL:

1 sudo mysqladmin -u root password newpassword
4, allow users to remotely login authorization

GRANT all privileges on * * to ' user ' @ '% ' identified by ' password ' with GRANT OPTION;



This article reproduced: http://www.blogjava.net/yjhmily/articles/336926.html

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.