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