Recently, I have been developing ecms3000. I have encountered many problems when I want to use databases and install mysql databases on the development server. now I will summarize the issues and take notes for myself. One installation process 1. view the system's own version rpm-qa | grepmysql // terminal returns mysql-5.1.69-1.el6_4.x86_64mysql-server-5.1.69-1.el6_4.x86_64mysql-libs-5.1.69-1.e
Recently, I have been developing ecms 3000. I have encountered many problems when I want to use databases and install mysql databases on the development server. now I will summarize the issues and take notes for myself.
1. installation process
1. view the system version
|
Rpm-qa | grep mysql // terminal return mysql-5.1.69-1.el6_4.x86_64mysql-server-5.1.69-1.el6_4.x86_64mysql-libs-5.1.69-1.el6_4.x86_64 |
2. for uniform installation, uninstall the system version first.
|
Rpm-e -- nodeps mysql-libs-5.1.69-1.el6_4.x86_64 // there may be errors and warnings by using the following command rpm-e -- allmatches -- nodeps mysql-server |
3. install mysql
|
Yum-y install mysql-server // The installation is complete. check the rpm-qi mysql-server version. |
4. start and stop, restart command
|
// Start service mysqld start // stop service mysqld stop // restart service mysqld restart |
5. add the boot service
|
Chkconfig mysqld on // check whether the startup is efficient. chkconfig -- list mysqld // if this happens, mysqld 0: disable 1: disable 2: Enable 3: Enable 4: enable 5: enable 6: disable |
6. important settings
|
// Modify the encoding and support Chinese vi/edc/my. cnf // add a default-character-set = utf8 under [mysqld] // set the database root password mysqladmin-u root password 19810316 // log on to the database mysql-u root-p // allows the root user to remotely log on to mysql> grant all privileges on *. * to root @ "%" identified by "zc1230"; mysql> flush privileges; // view the current encoding mysql> show variables like '% character % '; // enable the firewall to allow Database Access-a input-p tcp-m state -- state NEW-m tcp -- dport 3306-j ACCEPT // restart the firewall service iptables restart |
2. if you encounter the following problems, please solve them in this way
2.1 failed to start normally. check the log with the following error:
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
This problem is generally caused by forced power failure on the server. after a trip, it should be solved in this way.
|
// View the mysql process ps-ef | grep mysql // Two Dead processes kill-9 Process Number // restart normal // method 2, the second directly put mysql. rename the sock file. You can also delete it. we recommend that you change the name to mv/var/lib/mysql. sock/var/lib/mysql. sock. bak // and restart it normally. |
2.2 Other questions to be added
III. database client
Here I recommend using MySQL front, which is easy to use and still on the Chinese interface.