1. Check if MySQL is installed
Check to see if MySQL is installed before installing it.
If so, execute # rpm-e MySQL or # rpm-e--nodeps mysql Delete.
2. Installation via YML
Enter # Yum list First | grep mysql command to view the downloadable version of the MySQL database available on Yum.
Then # yum install-y mysql-server mysql mysql-devel for installation.
When this interface appears, it means that it's installed.
This time you can enter # Rpm-qi mysql-server to see the MySQL information.
3. Modify MySQL Configuration and startup
Start the MySQL service by executing # service mysqld start.
Execute # Service MYSQLD status to see the state of MySQL.
In general, we all want MySQL to boot, so we'll go through # chkconfig--list | grep MySQL to see if MySQL is booting.
This time see not boot, execute # chkconfig mysqld on
Next we start to change the password, just when the service is started, there is a passage, through this statement to modify the initial password.
So execute #/usr/bin/mysqladmin-u root password ' newpwd '--here is the string that sets the password to "Newpwd".
4. Access to MySQL
Execute the # mysql-u root-p command, log in, and enter the password you just set.
This allows the database to be manipulated using SQL statements.
5. Remote Connection
In general, we develop using NAVICAT to connect to the database, and rarely operate directly on the server.
So we need to remotely connect to MySQL on the server.
After entering the information, there are several possible reasons for the connection error:
1, MySQL service is not up, enter the server to view the status.
2, the port is wrong (not the default 3306), or the port has a firewall.
3, MySQL does not allow remote connection. (This belongs to the above)
In that case, let's look at the bottom of the mouth.
Execute # NETSTAT-ANP, through which you can see that the port is open.
So change the settings in MySQL here.
First write here, Baidu is isn't allowed to connect MySQL server can solve this problem.
centos6.5 installing MySQL