Linux (CentOS 6.5) install MySQL

Source: Internet
Author: User
Tags mysql client

There are many ways to install software under Linux, which is installed using the simple and convenient yum

First, using Yum to install the MySQL service, the client

1. Check whether you have installed: Yum List installed | grep MySQL

2. Yum List installed | grep MYSQL

3. Query Result:


4, this is the MySQL I have installed, we can use the Remove method provided by Yum to remove these installed MySQL and related software: Yum-y remove PackageName

5, remove the existing software to install, install the MySQL client: Yum install PackageName (mysql)

6. Install MySQL server: Yum install Mysql-server

7, installation Devel:yum install Mysql-devel

MySQL has been installed, but after that, there must be a problem.

Second, MySQL various properties configuration

1. Character set encoding settings, after MySQL installation its configuration file after vim/etc/my.cnf opened under "Mysqld" Add: Default-character-set=utf-8

2. Start MySQL service: Services mysqld start or/etc/init.d/mysqld start

3. Check MySQL boot settings: chkconfig--list | Grepmysql


4, you are likely to be off, this time to add a property:

Chkconfig mysqld on #设定mysqld在各等级为on, "each level" includes 2, 3, 4, 5 ratings

5, you can also specify the level: Chkconfig--level MySQL on, at the level of Init 35 log on when the MySQL service automatically start

6 See if your settings were successful: Chkconfig--list | grep MySQL

7. Stop services: Service mysqld stop or/etc/init.d/mysqld stop

Here the installation setup is complete, we will log in, but the landing may not be smooth to see:

Third, client access to the service side of the problem

1, mysql-uroot password 123456

    • Error may be reported in error 2002 can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)

Reason:

(1) Service not started

(2) Add the following information in the VIM/ETC/MY.CNF:

[Client]

Socket=/var/lib/mysql/mysql.sock

Exit from Vim's flat mode and write the data in the compiler cache to the MY.CNF configuration file to save the exit

2, mysql-uroot-p Direct return

(1), may successfully enter the MySQL

(2), error, you do not have permission, because you have not created a user or something to say:

Resolution 1:

[1] under vim/etc/my.cnf mysqld add skip-grant-tables (Skip form permissions, no password can go directly into MySQL mode)

[2] After entering MySQL mode, update user Setpassword=password ("You password") where user = ' root ';

[3] quit; Quit service mysqld Restart and then MySQL should be o!

Resolution 2:

[1]service Mysqldstop

[2]mysqld_safe--skip-grant-tables & mysql-uroot-p Enter

[3]use MySQL;

[4] Update userset Password=password ("Newpass") whereuser= "root"; #更改密码为 Newpassord

[5] flushprivileges; #更新权限

[6] Quit quit

[7]service Mysqldrestart

Mysql-uroot-p New Password entry

Linux (CentOS 6.5) install MySQL

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.