如下是MySQL-5.6.25在CentOS7下的源码编译后的多实例配置步骤,但一直报一个错误,找一天没找到原因,请求大神出现指导。具体报错:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)。报错日志会在配置最后。
在本文中,通过在mysql上开启两个端口(3306和3307来配置多实例,因为下面的主从同步要使用这两个端口来模拟)
1)创建目录(log目录是存放mysql日志的地方)可以看到3306端口重启成功,同理可以重启3307端口。
报错日志内容如下:
150722 02:15:24 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2015-07-22 02:15:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for
more details).
2015-07-22 02:15:33 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.25) starting as process 10316 ...
2015-07-22 02:15:33 10316 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
2015-07-22 02:15:33 10316 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-07-22 02:15:33 10316 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-22 02:15:33 10316 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-22 02:15:33 10316 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-22 02:15:33 10316 [Note] InnoDB: Memory barrier is not used
2015-07-22 02:15:33 10316 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-22 02:15:33 10316 [Note] InnoDB: Using Linux native AIO
2015-07-22 02:15:33 10316 [Note] InnoDB: Using CPU crc32 instructions
2015-07-22 02:15:33 10316 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-22 02:15:33 10316 [Note] InnoDB: Completed initialization of buffer pool
2015-07-22 02:15:34 10316 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-07-22 02:15:34 10316 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-07-22 02:15:34 10316 [Note] InnoDB: Database physically writes the file full: wait...
2015-07-22 02:15:39 10316 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-07-22 02:15:44 10316 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-07-22 02:15:45 10316 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-07-22 02:15:45 10316 [Warning] InnoDB: New log files created, LSN=45781
2015-07-22 02:15:45 10316 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-07-22 02:15:46 10316 [Note] InnoDB: Doublewrite buffer created
2015-07-22 02:15:46 10316 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-22 02:15:46 10316 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-07-22 02:15:46 10316 [Note] InnoDB: Foreign key constraint system tables created
2015-07-22 02:15:46 10316 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-07-22 02:15:46 10316 [Note] InnoDB: Tablespace and datafile system tables created.
2015-07-22 02:15:46 10316 [Note] InnoDB: Waiting for purge to start
2015-07-22 02:15:46 10316 [Note] InnoDB: 5.6.25 started; log sequence number 0
2015-07-22 02:15:46 10316 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID:
3cb1ba28-3052-11e5-889e-000c29144a61.
2015-07-22 02:15:46 10316 [Note] Server hostname (bind-address): '*'; port: 3306
2015-07-22 02:15:46 10316 [Note] IPv6 is available.
2015-07-22 02:15:46 10316 [Note] - '::' resolves to '::';
2015-07-22 02:15:46 10316 [Note] Server socket created on IP: '::'.
2015-07-22 02:15:46 10316 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
150722 02:15:47 mysqld_safe mysqld from pid file /usr/local/mysql/data/bogon.pid ended
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
2015-07-22 02:15:33?哥们你起来好早啊!
######看日志,是表不存在,是不是复制data 的时候出错了?######应该不是,到第七步都是成功的操作,在第八步启动数据库时提示没有mysql.sock文件,我在网上找半天出没有相类似的问题。在/tmp/及/var/lib/mysql/下都没有这个文件存在。######不知道耶######你要把原来data目录下的文件拷贝到data中,mysqld_multi ######所有文件及文件夹都拷贝到新的data目录下?用在重构吗?