installing MySQL under CentOS

Source: Internet
Author: User
Tags install php

You need to install: Devel,client,server

1, first of all to see if there is already installed MySQL, in order to avoid conflict
# Rpm-qa | grep MySQL
2. Uninstall conflicting versions
# RPM-E Mysql-version//To unload the passenger service and server side

3. Install MySQL customer service and server side

RPM installation, depending on the version of MySQL to be installed, specify the name differently.

RPM-IVH mysql-server-5.5.16-1.rhel4.i386.rpm mysql-client-5.5.16-1.rhel4.i386.rpm mysql-devel-5.5.16-1.rhel4.i386.rpm

If you do not have a local installation package, consider using the yum command to download

# yum-y Install Mysql-server

# yum-y Install Php-mysql

4, after installation, MySQL automatically start, default no user name and password, set a new password
#/usr/bin/mysqladmin-u root password ' 123456′
5. Log in to MySQL
>mysql-uroot-p
Enter Password: ' 123456′
6. Assign permissions to the host you are connected to
>mysql GRANT select,insert,update,delete On * * to [e-mail protected] identified by ' 123456′; XXX.XXX.X.XX is your IP.
7. Change the MySQL default character set
# CP MY-MEDIUM.CNF/ETC/MY.CNF
Add Default-character-set=utf8 under [client]
Add Default-character-set=utf8 under [mysqld]
8. Set MySQL boot from start
# vi/etc/rc.local
Add the following line
/usr/share/mysql/mysql.server start
9. Restart MySQL
#/etc/init.d/mysql Restart

Related Article

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.