Install MySQL and uninstall MySQL method under Ubuntu

Source: Internet
Author: User

First of all:
The other system may be

sudo apt-get install Libaio

But in Ubuntu Kylin need

MySQL hint: the server quit without updating PID file problem Solving method

Error Place:

MySQL server PID file could not being found! Failed Starting MySQL ... The server quit without updating PID file (/usr/local/mysql/data/snsgou.pid). Failed

Google, the problem may be caused by a variety of reasons, the best way is to check the error log first:
1, may be the/usr/local/mysql/data/mysql.pid file does not have the permission to write
Workaround: Give permission, execute "chown-r mysql:mysql/var/data" "Chmod-r 755/usr/local/mysql/data" and restart mysqld!

2. The MySQL process may already exist in the process
WORKAROUND: Use the command "Ps-ef|grep mysqld" to see if there is a mysqld process, kill with "kill-9 process number" and then restart mysqld!

3, may be the second time to install MySQL on the machine, there are residual data affect the start of the service.
Workaround: Go to MySQL data directory/data See, if there is mysql-bin.index, quickly delete it, it is the culprit. I am using the third method to solve!

4, MySQL will use the/ETC/MY.CNF configuration file when the configuration file is not specified at startup, please open this file to see if there is a specified data directory (DATADIR) under the [Mysqld] section.
WORKAROUND: Please set this line under [mysqld]: DataDir =/usr/local/mysql/data

5. skip-federated field Problem
Workaround: Check the/etc/my.cnf file for any skip-federated fields that have not been commented out, and if so, comment them out immediately.

6. Error log directory does not exist
Workaround: Use "Chown" "chmod" command to give MySQL owner and permissions

7, the disaster of SELinux, if it is a CentOS system, default will open SELinux
Workaround: Turn it off, open the/etc/selinux/config, change the selinux=enforcing to selinux=disabled, and then save the restart machine and try again.

The installation method found from another address;

1. Delete MySQL
sudo apt-get autoremove--purge mysql-server-5.0sudo apt-get remove Mysql-serversudo apt-get autoremove Mysql-serversudo Apt-get Remove Mysql-common (very important)
2. Clean up residual data
Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p
3. Install MySQL
sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo apt-get Install Php5-mysql ( Installing Php5-mysql is to connect PHP with MySQL) sudo apt-get install Libmysqlclient-dev

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
sudo netstat-tap | grep MySQL

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

[email protected]:~# sudo netstat-tap | grep mysqltcp        0      

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

Sudo/etc/init.d/mysql restart

Check if the installation was successful by following the command:

sudo netstat-tap | grep MySQL

After checking with the above command, if you see a socket with MySQL in the Listen state, the installation is successful.

Log in to MySQL database by the following command:

-U means to select the login user name,-p indicates the login user password, the above command input will prompt for a password, then enter the password can log in to MySQL.

This article transferred from: http://blog.csdn.net/lllliulin/article/details/51520203

Install MySQL and uninstall MySQL method under Ubuntu

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.