CentOS 7安装MySql5.7问题php
mysqlmysql
报错Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.须要在/etc/my.cnf中添加sql
[mysqld]数据库
user=mysql # 使用mysql用户缓存
报错Access denied for user 'root'@'localhost' (using password:YES),须要修改密码php7
首先配置/etc/my.cnf中添加编辑器
[mysqld]php-fpm
skip-grant-tables=1# 略过密码验证this
而后systemctl restart mysqld重启后进入mysql命令行
use mysql;
update user set password=password("*******") where user="*******"; #修改密码报错
报错ERROR 1054 (42S22): Unknown column 'password' in 'field list' 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改为了authentication_string
update mysql.user set authentication_string=password('*******') where user='*******'; #修改密码成功
flush privileges; #当即生效
在mysql命令行报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
SET PASSWORD = PASSWORD('123456');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;
phpmyadmin
报错:配置文件如今须要一个短语密码。
在 phpMyAdmin 文件中找到一个文件“config.sample.inc.php”,这是phpMyAdmin配置文件的样本文件,咱们须要把该文件复制,而后重命名为“config.inc.php”,config.inc.php是phpMyAdmin的配置文件,编辑器打开 config.inc.php 搜索下面一行代码$cfg\['blowfish\_secret'\] = '';,将后面单引号里面随便填入个字符串便可,打开phpMyAdmin/libraries/config.default.php文件$cfg['blowfish_secret'] = '';修改成一样密码
报错:$cfg['TempDir'] (./tmp/) 读取失败且不能创建缓存, phpMyAdmin运行速度将受影响.
手动在phpmyadmin的根目录创建tmp文件,赋予读写权限便可。
-报错:mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637···
根据安装php版本先删除php-mysqlyum remove php-mysql,而后安装php-mysqlnd,个人php事7.2因此用yum install php72w-mysqlnd
最后killall php-fpm而后再次启动php-fpm便可