MySQL Server installation and configuration

Source: Internet
Author: User
Tags server installation and configuration

PS: This article is reproduced from http://blog.csdn.net/lyjinger/article/details/1648845

Lyjinger software: MySQL Server installation and configuration

Note: I have some experiences in installing and configuring the MySQL server. MySQL 5.0.41, platform: linux-i386

1. MySQL installation steps:
1. decompress and install the SDK (source code package SRC installation and Binary Package bin installation)
In fact, the installation of MySQL is relatively simple. Just install it.
For the source code package, the steps are as follows:
Tar-zxvf mysql-5.0.41.tar.gz
./Configure -- prefix =/usr/local/MySQL/
-- With-extra-charsets = GBK/
-- With-charset = GBK
Make
Make install
For a Binary Package, perform the following steps:
CD/usr/local
Tar-zxvf mysql-5.0.41-linux-i686.tar.gz
Ln-s mysql-5.0.41-linux-i686 MySQL

2. Add database users and groups
Groupadd MySQL
Useradd-G MySQL

3. Install the database
CD/usr/local/MySQL
Ln-S/usr/local/MySQL/bin/MySQL/usr/local/bin/MySQL
CP support-files/my-medium.cnf/etc/My. CNF
Bin/mysql_install_db -- user = MySQL
Chown-r root.
SRC package execution:
Chown-r MySQL VaR
Bin package execution:
Chown-r Mysql Data
Chgrp-r MySQL.

4. test whether the installation is successful.
Bin/mysqld_safe -- user = MySQL &
Mysql-u root-P (Note: The initial password of the root user is blank. Press Enter Password: To press Enter .)
If you enter the MySQL prompt, the installation is successful. Otherwise, the installation fails. Check the preceding installation steps.

Ii. MySQL configuration (for your reference only ):
1. Configure MySQL self-starting service
CP support-files/MySQL. Server/etc/init. d
Ln-S/etc/init. d/MySQL. Server/etc/rc3.d/s99mysql
Ln-S/etc/init. d/MySQL. Server/etc/rc0.d/k01mysql
Reboot to test whether the self-starting service is successful

2. Database User, password, and access permission settings:
Mysql-u root-P
Use MySQL;
Delete Anonymous Users:
Delete from user where user = '';
Set the root user password:
Set password for 'root' @ '127. 0.0.1 '= PASSWORD (' [newpassword] ');
Set password for 'root' @ 'localhost' = PASSWORD ('[newpassword]');
Set password for 'root' @ 'hostname' = PASSWORD ('[newpassword]');
Flush privileges;

Set remote access:
Grant all privileges on *. * To 'root' @ '% 'identified by' [newpassword] 'with grant option;

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.