问题1:
Starting MySQL...Manager of pid-file quit without updating[failue]
解决办法:
修改启动脚本文件:/etc/init.d/mysqld
conf=/usr/local/mysql/etc/my.cnf
问题2:
[root@localhost scripts]# ./mysql_install_db --user=mysql --datadir=/database/mydata
FATAL ERROR: please install the following Perl modules before executing ./mysql_install_db:
Data::Dumper
解决办法:[root@localhost scripts]# rpm -ivh /mnt/Packages/perl-Data-Dumper-2.145-3.el7.x86_64.rpm
warning: /mnt/Packages/perl-Data-Dumper-2.145-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:perl-Data-Dumper-2.145-3.el7 ################################# [100%]
方案2
解决方法 :安装autoconf库
命令:yum-y install autoconf
linux 安装mysql 报错 :
Installing MySQL system tables.../usr/local/mysql//bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
安装 yum -y install libaio-devel 之后问题还是依旧 CentOS 7.3 64位
少东西,centos用yum装yum -y install numactl
问题3:
linux启动mysql报Fatal error:Can't change to run as user 'mysql' Please check that the user exists
解决办法:
1、创建mysql用户
useradd mysql
2、mysql目录改为mysql读写权限
chown -R mysql:mysql /var/lib/mysql
chown -R mysql:mysql /usr/local/mysql
问题4
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/database/mydata
Installing MySQL system tables...2015-10-30 14:18:43 5981 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-30 14:18:43 5981 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-30 14:18:43 5981 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-30 14:18:43 5981 [Note] InnoDB: Memory barrier is not used
2015-10-30 14:18:43 5981 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-10-30 14:18:43 5981 [Note] InnoDB: Using CPU crc32 instructions
2015-10-30 14:18:43 5981 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-30 14:18:43 5981 [Note] InnoDB: Completed initialization of buffer pool
2015-10-30 14:18:43 5981 [Note] InnoDB: Restoring page 0 of tablespace 0
2015-10-30 14:18:43 5981 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2015-10-30 14:18:43 5981 [ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
2015-10-30 14:18:43 5981 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2015-10-30 14:18:43 5981 [ERROR] Plugin 'InnoDB' init function returned error.
2015-10-30 14:18:43 5981 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-10-30 14:18:43 5981 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-10-30 14:18:43 5981 [ERROR] Aborting
2015-10-30 14:18:43 5981 [Note] Binlog end
2015-10-30 14:18:43 5981 [Note] ./bin/mysqld: Shutdown complete
解决办法:
1.删除数据库目录下的文件ib_logfile0和ib_logfile1,我在安装时定义的数据库目录是/database/mydata
rm -rf /database/mydata/l
2.再次执行脚本
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/database/mydata
安装mysql 5.7过程中出现如下问题:
[root@db mysql-5.7]# bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.7/ --datadir=/u01/data/mysql/
2018-12-25 18:46:40 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2018-12-25 18:46:40 [ERROR] Child process: /usr/local/mysql-5.7/bin/mysqldterminated prematurely with errno= 32
2018-12-25 18:46:40 [ERROR] Failed to execute /usr/local/mysql-5.7/bin/mysqld --bootstrap --datadir=/u01/data/mysql --lc-messages-dir=/usr/local/mysql-5.7/share --lc-messages=en_US --basedir=/usr/local/mysql-5.7
-- server log begin --
/usr/local/mysql-5.7/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
-- server log end --
解决方法:
下载文件numactl-2.0.9-2.el6.x86_64.rpm,然后安装即可。
[root@db soft]# chmod +x *.rpm
[root@db soft]# rpm -ivh numactl-2.0.9-2.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:numactl ########################################### [100%]
5、常见问题汇总:
[root@iZ2zeg11g0cdei5171kqskZ mysql]# ./scripts/mysql_install_db --user=mysqlInstalling MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory解决:
yum -y install libaio-devel
[root@iZ2zeg11g0cdei5171kqskZ mysql]# service mysqld startStarting MySQL.touch: cannot touch '/var/log/mariadb/mariadb.log': No such file or directorychmod: cannot access '/var/log/mariadb/mariadb.log': No such file or directorytouch: cannot touch '/var/log/mariadb/mariadb.log': No such file or directorychown: cannot access '/var/log/mariadb/mariadb.log': No such file or directory/usr/local/mysql//bin/mysqld_safe: line 129: /var/log/mariadb/mariadb.log: No such file or directory/usr/local/mysql//bin/mysqld_safe: line 166: /var/log/mariadb/mariadb.log: No such file or directorytouch: cannot touch '/var/log/mariadb/mariadb.log': No such file or directorychown: cannot access '/var/log/mariadb/mariadb.log': No such file or directorychmod: cannot access '/var/log/mariadb/mariadb.log': No such file or directory/usr/local/mysql//bin/mysqld_safe: line 129: /var/log/mariadb/mariadb.log: No such file or directoryThe server quit without updating PID file (/var/lib/mysql/i[FAILED]0cdei5171kqskZ.pid).解决:(我们确实是没有/var/log/mariadb/mariadb.log 这个目录,这个是因为你没有指定他的配置文件的话,他会默认找到/etc/my.cnf 这个配置文件,因为我们修改了mysql的数据存储目录)、
rm -f /etc/my.cnf
[root@iZ2zeg11g0cdei5171kqskZ mysql]# mysql -uroot -p-bash: mysql: command not found解决:(这个是因为/usr/local/bin目录下缺失mysql导致,只需要一下方法建立软链接,即可以解决)
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysqlsqlyog连接时,报1130错误,是由于没有给远程连接的用户权限问题解决1:更改 ‘mysql’数据库‘user’表‘host’项,从‘localhost’改成‘%’。
use mysql;
select 'host' from user where user='root';
update user set host = '%' where user ='root';
flush privileges;
解决2:直接授权
GRANT ALL PRIVILEGES ON . TO ‘root’@'%’ IDENTIFIED BY ‘youpassword’ WITH GRANT OPTION;-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: 没有那个文件或目录解决:
yum -y install perl perl-develInstalling MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory解决:
yum -y install libaio-devel环境变量配置位置:
vi + /etc/profile
远程访问时要关闭防火墙或者打开mysql的端口,如果用的阿里云则要在服务器管理界面对端口进行设置,而不是在系统内部设置