Mysql Installation
Installation
Yum-y install MySQL mysql-server php-mysql perl-dbd-mysql perl-dbi php-gd php-mbstring
Start
Service mysqld Start
Set Password
mysqladmin-u root password ' set '
Set UTF8 Universal code, add the following two narrative sentences
Vi/etc/my.cnf
[Mysqld]
Default-character-set=utf8
[Client]
Default-character-set=utf8
Forget password (note, make sure there is no important information, or start the action if you have already backed up)
Service Mysqld Stop
Rm-rf/var/lib/mysql
Service mysqld Start
Modify password
mysqladmin Password New password
Fire?? setting, limiting the source of use
Vi/etc/sysconfig/iptables
-A rh-firewall-1-input-m state--state new-m tcp-p tcp-s 192.168.10.0/24--dport 3306-j ACCEPT (network segment)
-A rh-firewall-1-input-m state--state new-m tcp-p tcp-s 192.168.10.1--dport 3306-j ACCEPT (stand-alone)
Manager Login
Mysql-u root-p
Repository Backup directives
Mysqldump-uroot-p-A--default-character-set=utf8 > Mysql.sql (all databases)
Mysqldump-uroot-p-a--default-character-set=utf8 xoops > xoops.sql (Single database Xoops)
Mysql-uroot-p < Mysql.sql (all database restore)
MySQL--user=root-p xoops </var/www/html/xoops.sql (single database Restore XOOPSL)
rpm Reinstall MySQL
Download the relevant RPM files to the official website first
Suggest downloading related files to the archives server of http://ftp.isu.edu.tw/pub/Linux/CentOS/University
This time to CentOS 5 version as an example (because of the failure to encounter MYSLQD only this article)
Cd/tmp
Mysqldump-uroot-p-A--default-character-set=utf8 > Mysql.sql (back up all repositories first)
wget http://ftp.isu.edu.tw/pub/Linux/CentOS/5.9/updates/i386/RPMS/mysql-5.0.95-5.el5_9.i386.rpm http:// ftp.isu.edu.tw/pub/linux/centos/5.9/updates/i386/rpms/mysql-bench-5.0.95-5.el5_9.i386.rpm http://ftp.isu.edu.tw /pub/linux/centos/5.9/updates/i386/rpms/mysql-devel-5.0.95-5.el5_9.i386.rpm http://ftp.isu.edu.tw/pub/Linux/ centos/5.9/updates/i386/rpms/mysql-server-5.0.95-5.el5_9.i386.rpm http://ftp.isu.edu.tw/pub/Linux/CentOS/5.9/ updates/i386/rpms/mysql-test-5.0.95-5.el5_9.i386.rpm
When the download is complete, perform the installation www.111cn.net
RPM-IVH mysql-5.0.95-5.el5_9.i386.rpm mysql-bench-5.0.95-5.el5_9.i386.rpm mysql-devel-5.0.95-5.el5_9.i386.rpm/ mysql-server-5.0.95-5.el5_9.i386.rpm mysql-test-5.0.95-5.el5_9.i386.rpm
If you encounter a related message, you can force the installation! This time again met (102.10.25)
xxx1 conflicts with file from package xxx2
RPM-UVH--force mysql-5.0.95-5.el5_9.i386.rpm mysql-bench-5.0.95-5.el5_9.i386.rpm mysql-devel-5.0.95-5.el5_9. i386.rpm/mysql-server-5.0.95-5.el5_9.i386.rpm mysql-test-5.0.95-5.el5_9.i386.rpm
After installation, you can start mysqld
Service mysqld Start
Set Password
mysqladmin-u root password ' set '
Rewind the Database
Mysql-uroot-p < Mysql.sql (all database restore)
Check to install its kit
Yum-y install MySQL mysql-server php-mysql perl-dbd-mysql perl-dbi php-gd php-mbstring
Yum re-install MySQL
Back up all repositories first
Mysqldump-uroot-p-A--default-character-set=utf8 > Mysql.sql
Remove the fault mysqld again
Service Mysqld Stop
Yum-y Remove mysql*
Rm-rf/var/lib/mysql
Reinstall MYSQLD
Yum-y install MySQL mysql-server php-mysql perl-dbd-mysql perl-dbi php-gd php-mbstring
Service mysqld Start
If you start an exception
Try A
Touch/var/lib/mysql/mysql.sock
Chown Mysql:mysql/var/lib/mysql/mysql.sock
chmod 4777/var/lib/mysql/mysql.sock
Still no success enabled, restore your socket
Mysqld_safe--user=mysql &
Try two (100 years 0118 that once in this way solved)
mysql_install_db
Set Password
mysqladmin-u root password ' set '
Rewind the Database
Mysql-uroot-p < Mysql.sql (all database restore)
phpMyAdmin
Yum installation software
Yum-y Install phpMyAdmin php-mbstring php-gd php-mcrypt
Set
vi/usr/share/phpmyadmin/config.inc.php
Tar installation
Please go to the official website to download the latest version of phpMyAdmin, this site provides version (2013.10.25) phpmyadmin-4.0.8-all-languages.zip
http://www.phpmyadmin.net/home_page/index.php
Tar jvxf phpmyadmin-3.0.1-all-languages.tar.bz2-c/var/www/html/
Cd/var/www/html/phpmyadmin
CP config.sample.inc.php config.inc.php
Set
vi/var/www/html/phpmyadmin/config.inc.php
-------------------------------------------------------------------------------
Change the cookie to HTTP authentication method 111cn.net
$cfg [' blowfish_secret '] = ' encrypt digital text ';
$cfg [' Servers '] [$i] [' auth_type '] = ' http ';
Alias settings, let the page read the place
Vi/etc/httpd/conf.d/phpmyadmin.conf
<directory "/usr/share/phpmyadmin" >
Order Deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.10.x #建议指定IP, security considerations
</Directory>
Alias/phpmyadmin/usr/share/phpmyadmin
Alias/pa/usr/share/phpmyadmin #有机器人会扫瞄phpmyadmin, the suggestion uses the unpopular word!
When you are done, modify the permissions before restarting
chmod 755/usr/share/phpmyadmin
Service httpd Restart
Next, test whether the website is successfully enabled
Http://IP/pa
PS: When setting up a database, we recommend coding Uft8_general.ci
"utf8_swedish_ci" turn into "utf8_general_ci"
The Emed802epx.zip tool can be used to turn proofreading "utf8_swedish_ci" into common "utf8_general_ci"
vi/var/www/html/phpmyadmin/libraries/select_lang.lib.php
Yum version
vi/usr/share/phpmyadmin/libraries/select_lang.lib.php
Find//mysql charsets Map
' Utf-8 ' = ' utf-8 ',
Change into
' Utf-8 ' = ' latin1 ',
And then restart Apache
Service httpd Restart
So phpmyadmin can display the correct Chinese characters, after the output, in the use of EmEditor, save the new file into a utf-8 format, then the data into the database.
Single Repository Export
Mysqldump-uroot-p-a--default-character-set=utf8 xoops > Xoops.sql
Single Repository Import
MySQL Xoops < xoops.sql-u root-p--default-character-set=utf8