The most versatile solution to the various problems of MySQL database

Source: Internet
Author: User
Tags php and mysql

Install MySQL and uninstall MySQL method under Ubuntu

1. Delete MySQL

sudo apt-get autoremove--purge mysql-server-5.0sudo apt-get remove mysql-sudo apt-get autoremove mysql- sudo apt-get remove Mysql-common (very important)   

In fact, some of the above is redundant, it is recommended to follow the order

2. Clean up residual data

Dpkg-l | grep ^rc| '{print $}' |  Xargs dpkg-p    

3. Install MySQL

Install mysql-installmysql-installs Php5-mysql (installation php5-mysql is to connect PHP and MySQL together) 

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:

4. Check if MySQL is running

grep MySQL

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

[email protected]:~# sudo netstat-tap | grep mysqltcp        0      0 localhost.localdo:mysql *:*                     LISTEN   

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

Sudo/etc/init.d/mysql restart

The most versatile solution to the various problems of MySQL database

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.