Monday, June 3, 2013

Mysql install on Gentoo

I've tried to install Mysql with emerge but without success. That's why, I install it manually by following the install file in the binary distribution :

  • shell> groupadd mysql
  • shell> useradd -r -g mysql mysql
  • shell> cd /usr/local
  • shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
  • shell> ln -s full-path-to-mysql-VERSION-OS mysql
  • shell> cd mysql
  • shell> chown -R mysql .
  • shell> chgrp -R mysql .
  • shell> scripts/mysql_install_db --user=mysql
I have the following error :

Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

To solve this issue , I install libaio with emerge dev-libs/libaio

  • shell> chown -R root .
  • shell> chown -R mysql data
  • shell> cp support-files/my-medium.cnf /etc/my.cnf
  • shell> bin/mysqld_safe --user=mysql &
In the file monfichier.err which is located in  /usr/local/mysql/data/ I have the following error : Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

I solve the problem with mysql_install_db --user=mysql --ldata=/usr/local/mysql/data/


Note :

I have the same error with :
GRANT ALL ON tbl.* TO 'user'@'localhost' IDENTIFIED BY 'tbl';
==> Error Mysql.User doesn't exist

In fact, I have an old version of Mysql on my computer. So, I unstall it and I type the following :

./scripts/mysql_install_db --user=mysql --ldata=/usr/local/mysql/data/
Installing MySQL system tables...2013-06-03 13:28:20 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-06-03 13:28:20 7779 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-03 13:28:20 7779 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-06-03 13:28:20 7779 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-03 13:28:20 7779 [Note] InnoDB: Using Linux native AIO
2013-06-03 13:28:20 7779 [Note] InnoDB: Not using CPU crc32 instructions
2013-06-03 13:28:20 7779 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-06-03 13:28:20 7779 [Note] InnoDB: Completed initialization of buffer pool
2013-06-03 13:28:20 7779 [Note] InnoDB: Highest supported file format is Barracuda.
2013-06-03 13:28:20 7779 [Note] InnoDB: The log sequence numbers 1600614 and 1600614 in ibdata files do not match the log sequence number 1601046 in the ib_logfiles!
2013-06-03 13:28:20 7779 [Note] InnoDB: Database was not shutdown normally!
2013-06-03 13:28:20 7779 [Note] InnoDB: Starting crash recovery.
2013-06-03 13:28:20 7779 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-06-03 13:28:20 7779 [Note] InnoDB: Restoring possible half-written data pages
2013-06-03 13:28:20 7779 [Note] InnoDB: from the doublewrite buffer...
2013-06-03 13:28:20 7779 [Note] InnoDB: 128 rollback segment(s) are active.
2013-06-03 13:28:20 7779 [Note] InnoDB: Waiting for purge to start
2013-06-03 13:28:20 7779 [Note] InnoDB: 5.6.11 started; log sequence number 1601046
2013-06-03 13:28:24 7779 [Note] Binlog end
2013-06-03 13:28:24 7779 [Note] InnoDB: FTS optimize thread exiting.
2013-06-03 13:28:24 7779 [Note] InnoDB: Starting shutdown...
2013-06-03 13:28:25 7779 [Note] InnoDB: Shutdown completed; log sequence number 1626426
OK

Filling help tables...2013-06-03 13:28:25 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-06-03 13:28:25 7804 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-03 13:28:25 7804 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-06-03 13:28:25 7804 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-03 13:28:25 7804 [Note] InnoDB: Using Linux native AIO
2013-06-03 13:28:25 7804 [Note] InnoDB: Not using CPU crc32 instructions
2013-06-03 13:28:25 7804 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-06-03 13:28:25 7804 [Note] InnoDB: Completed initialization of buffer pool
2013-06-03 13:28:25 7804 [Note] InnoDB: Highest supported file format is Barracuda.
2013-06-03 13:28:25 7804 [Note] InnoDB: 128 rollback segment(s) are active.
2013-06-03 13:28:25 7804 [Note] InnoDB: Waiting for purge to start
2013-06-03 13:28:25 7804 [Note] InnoDB: 5.6.11 started; log sequence number 1626426
2013-06-03 13:28:25 7804 [Note] Binlog end
2013-06-03 13:28:25 7804 [Note] InnoDB: FTS optimize thread exiting.
2013-06-03 13:28:25 7804 [Note] InnoDB: Starting shutdown...
2013-06-03 13:28:27 7804 [Note] InnoDB: Shutdown completed; log sequence number 1626436
OK


...
Finished !