RPM安裝MySQL,登陸MySQL相關語句

rpm安裝mysql,登陸mysql的相關語句

1.安裝、啓動 rpm -ivh mysql-* --nodeps
service mysqld start
2.無密碼登陸 sudo vim /etc/mysql/my.cnf
#在[mysqld]項下添加
skip-grant-tables
service mysqld restart
3.更新創建密碼 update user set password=password("esa@2011") where user="root";
update user set authentication_string=password("esa@2011") where user="root";
flush privileges;
4.修改用戶密碼 alter user "root"@"localhost" identified by "esa@2011";
flush privileges;
5.數據庫

查看所有數據庫
show databases;
    
創建數據庫
create database name;
 
刪除數據庫
drop datebase name;

使用數據庫
use name;

6.查看musql版本 mysql -V
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章