Linux--mysql

Source: Internet
Author: User

One, MySQL installation

 See if MySQL is installed

Rpm-qa | grep mysql-server

Yum Install Mysql-server

Modifying a configuration file

Vim/etc/my.cnf

  

Set up system service startup

Chkconfig mysqld on

View settings Status

Chkconfig--list mysqld

  

Start MySQL

Service MySQL Restart

(Start stop)

If it fails to start, start with the following command

  /etc/rc.d/init.d/mysqld start

  

Second, the question

View Mysqld's log file

Less/var/log/mysqld.log

  (1) Mysql.sock does not exist links---> https://www.linuxidc.com/Linux/2009-09/21897.htm

  

Solution:

/etc/init.d/mysqld stop

1 $/usr/local/bin/mysql_install_db     //Rebuild Authorization Form 3 $/usr/local/bin/mysqld_safe &      

  /etc/init.d/mysqld start

Log in to MySQL

# MySQL

(2) Access denied for user ' root ' @ ' localhost

#/etc/rc.d/init.d/mysql Stop
# Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
# mysql-u Root MySQL
mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root ';
mysql> FLUSH privileges;
Mysql> quit

#/etc/init.d/mysql Restart
# mysql-uroot-p
Enter Password: < Enter the newly set password newpassword>

Mysql>

Linux--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.