Linux MySQL操作

Linux MySQL操作

 

Linux MySQL操作

 

sudo service mysqld restart

sudo service mysqld start

sudo service mysqld stop  停止服务

cat /var/log/mysqld.log | grep password   获取密码

mysql -uroot -p xxxxx输入密码进入sql

mysql -u root -p

进入mysql 

show databases; 展示有哪些数据

use mysql; 用mysql数据库

show tables; 表格

 select * from user \G; 查看user表数据有多少

\G 格式化显示

 select * from user \G; * 替换为 host 和user

select Host, User from user \G; 查看host和user表格

update user set host = '%' where Host = "localhost" and User = "root"; 允许任何地方都可以链接

 

 

 

 

 

 

 

 

 

相关文章:

  • 2021-06-13
  • 2021-08-18
  • 2021-11-30
  • 2021-11-30
  • 2022-01-07
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2022-01-11
相关资源
相似解决方案