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):


分享到:


相關文章: