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.數據庫 |
查看所有數據庫 使用數據庫 |
6.查看musql版本 | mysql -V |