View previous topic :: View next topic |
Author |
Message |
xtx Tux's lil' helper
Joined: 27 Dec 2011 Posts: 129
|
Posted: Fri Jan 30, 2015 8:42 pm Post subject: [RESOLVED] MySQL/MariaDB issue |
|
|
i haven't been able to run "mysql_upgrade"... i think it started a long time ago when i switched to systemd but i'm not sure. any idea what's going on?
mariadb-10.0.16 installed
Code: | sudo mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
Code: | ls /var/run/mysqld/
| (returns nothing)
Code: | sudo systemctl start mysqld
Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.
|
Code: | sudo systemctl status mysqld.service
* mysqld.service - MySQL database server
Loaded: loaded (/usr/lib64/systemd/system/mysqld.service; disabled)
Active: activating (start-post) since Fri 2015-01-30 14:41:09 CST; 1s ago
Main PID: 26106 (mysqld_safe); : 26107 (mysqld-wait-rea)
CGroup: /system.slice/mysqld.service
|-26106 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
`-control
|-26107 /bin/sh /usr/libexec/mysqld-wait-ready 26106
`-26421 sleep 1
Jan 30 14:41:11 work_gentoo systemd[1]: mysqld.service: control process exited, code=exited status=1
Jan 30 14:41:11 work_gentoo systemd[1]: Failed to start MySQL database server.
Jan 30 14:41:11 work_gentoo systemd[1]: Unit mysqld.service entered failed state.
Jan 30 14:41:12 work_gentoo systemd[1]: mysqld.service holdoff time over, scheduling restart.
Jan 30 14:41:12 work_gentoo systemd[1]: Stopping MySQL database server...
Jan 30 14:41:12 work_gentoo systemd[1]: Starting MySQL database server...
Jan 30 14:41:12 work_gentoo mysqld_safe[26439]: 150130 14:41:12 mysqld_safe unknown option '--err-log=/var/log/mysql/mysql.err'
Jan 30 14:41:12 work_gentoo mysqld_safe[26439]: 150130 14:41:12 mysqld_safe unknown option '--err-log=/var/log/mysql/mysql.err'
Jan 30 14:41:12 work_gentoo mysqld_safe[26439]: 150130 14:41:12 mysqld_safe Logging to '/var/log/mysql/mysqld.err'.
Jan 30 14:41:12 work_gentoo mysqld_safe[26439]: 150130 14:41:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql |
Code: | sudo find / -type s
/run/xdmctl/dmctl-:0/socket
/run/xdmctl/dmctl/socket
/run/dhcpcd.unpriv.sock
/run/dhcpcd.sock
/run/dbus/system_bus_socket
/run/user/1000/systemd/private
/run/user/1000/systemd/notify
/run/udev/control
/run/systemd/journal/socket
/run/systemd/journal/stdout
/run/systemd/journal/dev-log
/run/systemd/shutdownd
/run/systemd/private
/run/systemd/notify
/tmp/ksocket-kdm/kdeinit4__0
/tmp/.ICE-unix/381
/tmp/.X11-unix/X0
find: `/proc/3147/task/3147/fd/5': No such file or directory
find: `/proc/3147/task/3147/fdinfo/5': No such file or directory
find: `/proc/3147/fd/5': No such file or directory
find: `/proc/3147/fdinfo/5': No such file or directory
find: `/proc/3445': No such file or directory
find: File system loop detected; `/mnt/defvol/__active/rootvol' is part of the same file system loop as `/'.
find: `/mnt/defvol/__active/var/tmp/systemd-private-dbf4a22feb134e76b13b483b19b0efab-mysqld.service-JZjZo4': No such file or directory
|
Last edited by xtx on Tue Mar 03, 2015 7:45 pm; edited 1 time in total |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1660
|
Posted: Sat Feb 21, 2015 2:24 am Post subject: |
|
|
Quote: | Jan 30 14:41:12 work_gentoo mysqld_safe[26439]: 150130 14:41:12 mysqld_safe Logging to '/var/log/mysql/mysqld.err'. |
Please post from the above file a startup (or failed) |
|
Back to top |
|
|
xtx Tux's lil' helper
Joined: 27 Dec 2011 Posts: 129
|
Posted: Mon Mar 02, 2015 9:33 pm Post subject: |
|
|
Code: | [Note] CONNECT: Version 1.03.0006 Feb 5 2015 11:48:32
150302 15:24:24 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150302 15:24:24 [Note] InnoDB: The InnoDB memory heap is disabled
150302 15:24:24 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
150302 15:24:24 [Note] InnoDB: Memory barrier is not used
150302 15:24:24 [Note] InnoDB: Compressed tables use zlib 1.2.8
150302 15:24:24 [Note] InnoDB: Using Linux native AIO
150302 15:24:24 [Note] InnoDB: Not using CPU crc32 instructions
150302 15:24:24 [Note] InnoDB: Initializing buffer pool, size = 128.0M
150302 15:24:24 [Note] InnoDB: Completed initialization of buffer pool
150302 15:24:24 [Note] InnoDB: Highest supported file format is Barracuda.
150302 15:24:24 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463
150302 15:24:24 [Note] InnoDB: Database was not shutdown normally!
150302 15:24:24 [Note] InnoDB: Starting crash recovery.
150302 15:24:24 [Note] InnoDB: Reading tablespace information from the .ibd files...
150302 15:24:24 [Note] InnoDB: Restoring possible half-written data pages
150302 15:24:24 [Note] InnoDB: from the doublewrite buffer... InnoDB: Doing recovery: scanned up to log sequence number 1600614
150302 15:24:24 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed
150302 15:24:25 [Note] InnoDB: 128 rollback segment(s) are active.
150302 15:24:25 [Note] InnoDB: Waiting for purge to start
150302 15:24:25 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-71.0 started; log sequence number 1600614
150302 15:24:25 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150302 15:24:25 [Warning] /usr/sbin/mysqld: unknown option '--loose-federated'
150302 15:24:25 [Warning] /usr/sbin/mysqld: unknown option '--loose-federated'
150302 15:24:25 [Note] Recovering after a crash using mysqld-bin
150302 15:24:25 [Note] Starting crash recovery...
150302 15:24:25 [Note] Crash recovery finished.
150302 15:24:25 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
150302 15:24:25 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
150302 15:24:25 [Note] Server socket created on IP: '127.0.0.1'.
150302 15:24:25 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
150302 15:24:25 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150302 15:24:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150302 15:24:26 [Warning] No argument was provided to --log-bin and neither --log-basename or --log-bin-index where used; This may cause repliction to break when this server acts as a master and has its hostname changed! Please use '--log-basename=work_gentoo' or '--log-bin=mysqld-bin' to avoid this problem.
|
|
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1660
|
Posted: Mon Mar 02, 2015 9:39 pm Post subject: |
|
|
xtx wrote: | Code: |
150302 15:24:25 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
150302 15:24:25 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
|
|
Something happen to the data directory? Even mysql.user table does not exist which is a critical table where the users and passwords are kept.
The default path is /var/lib/mysql/mysql/user.* but you can modify this in my.cnf via datadir. Then it becomes $datadir/mysql/user.*
If this is a new install (never run on this machine before), you should be running `emerge --config dev-db/mariadb` instead of mysql_upgrade. |
|
Back to top |
|
|
BlueFusion Guru
Joined: 08 Mar 2006 Posts: 371
|
Posted: Mon Mar 02, 2015 10:57 pm Post subject: |
|
|
As stated above, this will fix your issue:
Quote: | emerge --config dev-db/mariadb |
Looks like you never ran it on that computer before. Or you deleted the data directory after you ran it. |
|
Back to top |
|
|
xtx Tux's lil' helper
Joined: 27 Dec 2011 Posts: 129
|
Posted: Tue Mar 03, 2015 4:48 pm Post subject: |
|
|
Thank you for the responses.
Unfortunately, emerge --config mariadb fails with:
Code: | Configuring pkg...
* Creating MySQL tmpdir /tmp/
* /tmp/
* Please provide a password for the mysql 'root' user now
* or through the /root/.my.cnf file.
* Avoid ["'\_%] characters in the password >
* Retype the password >
* Creating the mysql database and setting proper
* permissions on it ...
* Command: '/usr/share/mysql/scripts/mysql_install_db' '--basedir=/usr' --loose-skip-grant-tables --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --user=mysql '--datadir=///var/lib/mysql' '--tmpdir=///tmp/
* /tmp/'
* ERROR: dev-db/mariadb-10.0.16::gentoo failed (config phase):
* Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mariadb-10.0.16/temp/mysql_install_db.log *
* Call stack:
* ebuild.sh, line 93: Called pkg_config
* environment, line 4328: Called mysql-multilib_pkg_config
* environment, line 3952: Called die
* The specific snippet of code:
* die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"; *
* If you need support, post the output of `emerge --info '=dev-db/mariadb-10.0.16::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-db/mariadb-10.0.16::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-db/mariadb-10.0.16/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-db/mariadb-10.0.16/temp/environment'.
* Working directory: '/var/tmp/portage/dev-db/mariadb-10.0.16/temp'
* S: '/var/tmp/portage/dev-db/mariadb-10.0.16/work/mariadb-10.0.16' |
the mysqld.err log shows:
Code: | 150303 10:39:24 [Note] InnoDB: Waiting for purge to start
150303 10:39:24 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-71.0 started; log sequence number 0 /usr/sbin/mysqld: Too many arguments (first extra is '/tmp/').
150303 10:39:24 [ERROR] Aborting
150303 10:39:24 [Note] InnoDB: FTS optimize thread exiting.
150303 10:39:24 [Note] InnoDB: Starting shutdown...
150303 10:39:26 [Note] InnoDB: Shutdown completed; log sequence number 1600614
150303 10:39:26 [Note] /usr/sbin/mysqld: Shutdown complete |
|
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1660
|
Posted: Tue Mar 03, 2015 7:24 pm Post subject: |
|
|
xtx wrote: | Code: |
Configuring pkg...
* Creating MySQL tmpdir /tmp/
* /tmp/
|
|
Very odd to see that extra /tmp/ on an additional line.
What is the result of: Code: | /usr/bin/my_print_defaults mysqld | sed -n "/^--tmpdir=/s,--tmpdir=,,gp" |
|
|
Back to top |
|
|
xtx Tux's lil' helper
Joined: 27 Dec 2011 Posts: 129
|
Posted: Tue Mar 03, 2015 7:32 pm Post subject: |
|
|
/usr/bin/my_print_defaults mysqld | sed -n "/^--tmpdir=/s,--tmpdir=,,gp"
I assume that it's odd that it's listed twice? |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1660
|
Posted: Tue Mar 03, 2015 7:36 pm Post subject: |
|
|
xtx wrote: | /usr/bin/my_print_defaults mysqld | sed -n "/^--tmpdir=/s,--tmpdir=,,gp"
I assume that it's odd that it's listed twice? |
Yes. something is not right in your my.cnf. perhaps tmpdir is listed twice?? |
|
Back to top |
|
|
xtx Tux's lil' helper
Joined: 27 Dec 2011 Posts: 129
|
Posted: Tue Mar 03, 2015 7:44 pm Post subject: |
|
|
Well it wasn't listed twice in my.cnf but it was uncommented. I commented the line out and that fixed it. Successfully ran "emerge --config mariadb " as well as "mysql_upgrade". Thanks for your help! |
|
Back to top |
|
|
|