MySQL Settings change root password, connection, common commands

Source: Internet
Author: User

13.1 Setting Change root password
    • Setting environment variables
      The first direct use of MySQL will prompt ' This command does not exist ' because it has not been added to the environment variable, if you want to use the command, you need to use its absolute path:/usr/local/mysql/bin/mysql, for convenience, first add it to the system environment variable:
[[email protected] ~]# export PATH=$PATH:/usr/local/mysql/bin/

The MySQL command path is temporarily added to the environment variable, the variable is invalidated after the system restarts, and it needs to be added to the environment variable configuration file for permanent entry:

vi /etc/profile#在配置文件最后 把上面的命令加#执行source命令生效[[email protected] ~]# source /etc/profile
    • Change environment variable path, add MySQL absolute path
    • Mysqladmin-uroot password ' 123456 '
    • mysql-uroot-p123456
    • Password reset
    • VI/ETC/MY.CNF//Add Skip-grant
    • Restart MySQL service/etc/ini.d/mysqld restart
    • Mysql-uroot
    • Use MySQL;
    • Update user set Password=password (' Aa123456 ') where user= ' root ';
13.2 connecting mysql13.3 MySQL common commands

MySQL Settings change root password, connection, common commands

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.