MySQL遠程連接1130(navicat)

mysql -u root -p

mysql>use mysql;

mysql>select 'host' from user where user='root';

mysql>update user set host = '%' where user ='root';

mysql>flush privileges;

mysql>select 'host' from user where user='root';

mydql數據庫密碼為空時設置root密碼

第一次安裝 MySQL 或 MariaDB,你可以執行

mysql_secure_installation 來實現基本的安全設置。 其中的一個設置是數據庫的 root 密碼 —— 該密碼必須保密,並且只在必要的時候使用。

[root@server1 ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none):


分享到:


相關文章: