linux installation mysql steps

linux installation mysql steps:

1. Install software using yum on linux
yum install mysql-server -y
2. Start the mysql service
service mysqld start
3. Set the mysql service to boot up (after turning off the virtual machine, you may forget to turn on the service the next time you restart it, so after setting the mysql service, it will not take too much boot time)
chkconfig mysqld on
4. Enter the mysql command line and type the following command
mysql
5. mysql command line commands (you need to modify mysql login permissions after installing mysql)
--切换数据库
	use mysql
--查看表
	show tables
--查看表的数据
	select  host,user,password from user;
--插入权限数据
	grant all privileges on *.* to 'root'@'%' identified by '123' with grant option
--删除本机的用户访问权限(可以执行也可以不执行)	
	delete from user where host!='%'
--刷新权限或者重启mysqld的服务
	service mysqld restart;--(重启mysql服务)
	flush privileges;--(刷新权限)	

Guess you like

Origin blog.csdn.net/weixin_42096620/article/details/111871609