1.4允许root用户远程连接数据库
mysql -uroot -p;
use mysql;
select host,user,password from user;
update user set host = '%' where user = 'root';
#如果root用户已经有了"%",会提示下面的错误
" Duplicate entry '%-root' for key 'PRIMARY'"
grant all privileges on *.* to root@'%' identified by "root";
flush privileges;
--执行上面的命令时,不知道到怎么把密码给改了,root无法登录。
#1.5 MySQL 忘记口令的解决办法
如果 MySQL 正在运行,首先杀之: killall -TERM mysqld。
启动 MySQL :/usr/bin/mysqld_safe --skip-grant-tables &
就可以不需要密码就进入 MySQL 了。
然后就是
>use mysql
>update user set password=password("lw198962") where user="root";
>flush privileges;
重新杀 MySQL ,用正常方法启动 MySQL 。
---------------------------
1.6 安装mysql时,给的提示,非常有帮助
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
3.3 JDK环境变量
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program