mysql密码重置
忘记root用户密码:
vim /etc/my.cnf
在[mysqld]增加一行
skip_grant_tables
/etc/init.d/mysqld restart
- 增加之后再次进入mysql,输入密码直接按回车
- 进入之后在mysql命令行输入下面命令
mysql> update mysql.user set authentication_string='' where user='root';
- 退出,并且
vim /etc/my.cnf
注释或删除skip_grant_tables
/etc/init.d/mysqld restart
- 再次进入mysql
mysql -p
mysql> alter user root@localhost identified by 'Abc123;
mysql> flush previleges;
图形化管理mysql
- 在另一台虚拟机上也安装配置mysql
- nginx+php+phpMyadmin管理mysql
- 下载phpMyAdmin包
unzip phpMyAdmin-5.0.2-all-languages.zip ##解压
mv phpMyAdmin-5.0.2-all-languages /usr/local/nginx/html/phpmyadmin
##将解压后的目录复制到nginx发布目录
mv phpMyAdmin-5.0.2-all-languages phpmyadmin##为了方便访问,重命名
cd /usr/local/php/lib/
vim php.ini
##在[Pdo_mysql]和[mysql.default_socket]=后加/data/mysql/mysql.sock
systemctl start php-fpm
cd /usr/local/nginx/conf/
vim nginx.conf
##将index.php写在index.html,index.htm之前
systemctl start nginx
- 测试:在浏览器访问访问
172.25.9.1/phpmyadmin
通过账号密码登录
``