You are not logged in.
Pages: 1
Topic closed
I'm trying to get mysql working on my system. I installed the following packages from the AUR:
The arch wiki page on MySQL asks to run the following command:
# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
The problem is that the mysql_install_db command is not available after installation. And when I try to run the mysqld.service, I get the following error; which I believe is the result of me not running the mysql_install_db mentioned above.
● mysqld.service - MySQL database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
Active: activating (start-post) (Result: exit-code) since Sat 2018-08-25 14:43:50 BST; 6s ago
Process: 17701 ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Main PID: 17701 (code=exited, status=1/FAILURE); Control PID: 17702 (mysqld-post)
Tasks: 2 (limit: 4915)
Memory: 2.6M
CGroup: /system.slice/mysqld.service
├─17702 /bin/sh /usr/bin/mysqld-post
└─18438 sleep 1
Aug 25 14:43:50 archBox systemd[1]: Starting MySQL database server...
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.480932Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 1024 (requested 8161)
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.481041Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 431 (requested 4000)
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.708217Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.708270Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (mysqld 8.0.12) starting as process 17701
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.738415Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.738564Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.738579Z 0 [ERROR] [MY-010119] [Server] Aborting
Aug 25 14:43:50 archBox mysqld[17701]: 2018-08-25T13:43:50.738767Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.12) MySQL Community Server (GPL).
Aug 25 14:43:50 archBox systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
Any help for getting mysql running is welcomed. thanks.
Last edited by saifazmi (2018-08-28 10:13:43)
Offline
Are you sure the AUR package installs it?
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
Offline
like loqs pointed, the mysql_install_db command is deprecated in favor of mysqld.
The wiki page should be updated accordingly
Offline
Install mariadb, afterwards run the following command before starting the mariadb.service:
# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
The wiki page text seems accurate
MariaDB is the default implementation of MySQL in Arch Linux, provided with the mariadb package.
Alternative implementations are:Oracle MySQL — An implementation by Oracle Corporation.
https://www.mysql.com/ || mysqlAUR
Percona Server — An implementation by Percona LLC.
http://www.percona.com/software/percona-server/ || percona-server
Possibly it could be made explicitly clear alternative implementations provide differing functionality.
Offline
Hey everyone, thanks for all info so far. I fixed the issue in the following way:
Since mysql_install_db is deprecated as @loqs pointed out and thanks for the git diff link. I tried to run the following command:
$ sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
But that didn't work as the datadir already existed, so I deleted that directory.
$ sudo rm -rvf /var/lib/mysql
Ran this again:
$ sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Which initialized mysql again and generated a temporary password for root. I started the mysqld.service and logged into the root account using the temp password.
Thank you, everyone, for all the help so far. I agree that the wiki page should be updated.
Offline
Sure? I think the directory must already exist, at least for PerconaDB from the official repositories:
The server checks for the existence of the data directory as follows:
If no data directory exists, the server creates it.
If a data directory exists but is not empty (that is, it contains files or subdirectories), the server exits after producing an error message:
[ERROR] --initialize specified but the data directory exists. Aborting.
So I deleted /var/lib/mysql and tried it:
mysqld --initalize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
mysqld: Can't change dir to '/var/lib/mysql/' (OS errno 2 - No such file or directory)
...
It works with an empty data directory. I think the Wiki need to split up instructions for MySQL and PerconaDb from MariaDB. Furthermore MySQLWorkbench has some problems with MariaDB and vice versa, which is the reason why I prefer PerconaDB. MariaDB just doesn't offer a good native UI on Linux
NetBeans is also a mess nowadays, Thanks Oracle. Yep, I'm frustrated.
Last edited by hoschi (2019-01-08 17:50:55)
Offline
You know better than to necrobump a solved thread.
Closing
Offline
Pages: 1
Topic closed