LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   MariaDB/MySQL broken on fresh installation (https://www.linuxquestions.org/questions/slackware-14/mariadb-mysql-broken-on-fresh-installation-4175585476/)

horizn 07-25-2016 11:08 AM

MariaDB/MySQL broken on fresh installation
 
As usual I am trying to initialize MariaDB/MySQL on 14.2. Unfortunately can't run secure installation:


Code:

# mysql_install_db
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
160725 17:00:46 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 1361 ...
160725 17:00:46 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160725 17:00:46 [Note] InnoDB: The InnoDB memory heap is disabled
160725 17:00:46 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160725 17:00:46 [Note] InnoDB: Memory barrier is not used
160725 17:00:46 [Note] InnoDB: Compressed tables use zlib 1.2.8
160725 17:00:46 [Note] InnoDB: Using Linux native AIO
160725 17:00:46 [Note] InnoDB: Using CPU crc32 instructions
160725 17:00:46 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160725 17:00:46 [Note] InnoDB: Completed initialization of buffer pool
160725 17:00:46 [Note] InnoDB: Highest supported file format is Barracuda.
160725 17:00:46 [Note] InnoDB: 128 rollback segment(s) are active.
160725 17:00:46 [Note] InnoDB: Waiting for purge to start
160725 17:00:46 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616717
160725 17:00:46 [Note] InnoDB: FTS optimize thread exiting.
160725 17:00:46 [Note] InnoDB: Starting shutdown...
160725 17:00:48 [Note] InnoDB: Shutdown completed; log sequence number 1616727
OK
Filling help tables...
160725 17:00:48 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 1389 ...
160725 17:00:48 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160725 17:00:48 [Note] InnoDB: The InnoDB memory heap is disabled
160725 17:00:48 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160725 17:00:48 [Note] InnoDB: Memory barrier is not used
160725 17:00:48 [Note] InnoDB: Compressed tables use zlib 1.2.8
160725 17:00:48 [Note] InnoDB: Using Linux native AIO
160725 17:00:48 [Note] InnoDB: Using CPU crc32 instructions
160725 17:00:48 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160725 17:00:48 [Note] InnoDB: Completed initialization of buffer pool
160725 17:00:48 [Note] InnoDB: Highest supported file format is Barracuda.
160725 17:00:48 [Note] InnoDB: 128 rollback segment(s) are active.
160725 17:00:48 [Note] InnoDB: Waiting for purge to start
160725 17:00:48 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616727
160725 17:00:48 [Note] InnoDB: FTS optimize thread exiting.
160725 17:00:48 [Note] InnoDB: Starting shutdown...
160725 17:00:50 [Note] InnoDB: Shutdown completed; log sequence number 1616737
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h hostname password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/

# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")
Enter current password for root (enter for none):
Aborting!

Code:

# mysqladmin -u root password 'password'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!

I've tried to run mysql_upgrade as mentioned in log output but with no luck.

log:

Code:

160725 16:45:57 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/innodb_table_stats'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 16:45:57 [ERROR] InnoDB: Tablespace open failed for '"mysql"."innodb_table_stats"', ignored.
160725 16:45:57 [Note] InnoDB: 128 rollback segment(s) are active.
160725 16:45:57 [Note] InnoDB: Waiting for purge to start
160725 16:45:57 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616717
160725 16:45:57 [Note] Plugin 'FEEDBACK' is disabled.
160725 16:45:57 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160725 16:45:57 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
160725 16:45:57 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
160725 16:45:57 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
160725 16:57:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160725 16:57:43 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 1272 ...
160725 16:57:43 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160725 16:57:43 [Note] InnoDB: The InnoDB memory heap is disabled
160725 16:57:43 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160725 16:57:43 [Note] InnoDB: Memory barrier is not used
160725 16:57:43 [Note] InnoDB: Compressed tables use zlib 1.2.8
160725 16:57:43 [Note] InnoDB: Using Linux native AIO
160725 16:57:43 [Note] InnoDB: Using CPU crc32 instructions
160725 16:57:43 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160725 16:57:43 [Note] InnoDB: Completed initialization of buffer pool
160725 16:57:43 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-25 16:57:43 7f5e33e0d780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
160725 16:57:43 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/gtid_slave_pos'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 16:57:43 [ERROR] InnoDB: Tablespace open failed for '"mysql"."gtid_slave_pos"', ignored.
2016-07-25 16:57:43 7f5e33e0d780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
160725 16:57:43 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/innodb_index_stats'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 16:57:43 [ERROR] InnoDB: Tablespace open failed for '"mysql"."innodb_index_stats"', ignored.
2016-07-25 16:57:43 7f5e33e0d780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
160725 16:57:43 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/innodb_table_stats'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 16:57:43 [ERROR] InnoDB: Tablespace open failed for '"mysql"."innodb_table_stats"', ignored.
160725 16:57:43 [Note] InnoDB: 128 rollback segment(s) are active.
160725 16:57:43 [Note] InnoDB: Waiting for purge to start
160725 16:57:44 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616717
160725 16:57:44 [Note] Plugin 'FEEDBACK' is disabled.
160725 16:57:44 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160725 16:57:44 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
160725 16:57:44 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
160725 16:57:44 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended


Thom1b 07-25-2016 11:19 AM

Hi,

I think you miss to start the server after "mysql_install_db"

Code:

/etc/rc.d/rc.mysqld start

ml4711 07-25-2016 11:21 AM

You should create the database
this way to get the right permissions.

Code:

mysql_install_db --user=mysql
Cheers

horizn 07-25-2016 11:27 AM

Quote:

Originally Posted by Thom1b (Post 5581059)
Hi,

I think you miss to start the server after "mysql_install_db"

Code:

/etc/rc.d/rc.mysqld start

As you can see above it doesn't work at all for some reason.

Code:

root@:/var/lib/mysql# mysql_install_db
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
160725 17:21:38 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 2592 ...
160725 17:21:38 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160725 17:21:38 [Note] InnoDB: The InnoDB memory heap is disabled
160725 17:21:38 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160725 17:21:38 [Note] InnoDB: Memory barrier is not used
160725 17:21:38 [Note] InnoDB: Compressed tables use zlib 1.2.8
160725 17:21:38 [Note] InnoDB: Using Linux native AIO
160725 17:21:38 [Note] InnoDB: Using CPU crc32 instructions
160725 17:21:38 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160725 17:21:38 [Note] InnoDB: Completed initialization of buffer pool
160725 17:21:38 [Note] InnoDB: Highest supported file format is Barracuda.
160725 17:21:38 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463
160725 17:21:38 [Note] InnoDB: Database was not shutdown normally!
160725 17:21:38 [Note] InnoDB: Starting crash recovery.
160725 17:21:38 [Note] InnoDB: Reading tablespace information from the .ibd files...
160725 17:21:38 [Note] InnoDB: Restoring possible half-written data pages
160725 17:21:38 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1600607
160725 17:21:38 [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
160725 17:21:39 [Note] InnoDB: 128 rollback segment(s) are active.
160725 17:21:39 [Note] InnoDB: Waiting for purge to start
160725 17:21:39 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1600607
160725 17:21:39 [Note] InnoDB: FTS optimize thread exiting.
160725 17:21:39 [Note] InnoDB: Starting shutdown...
160725 17:21:41 [Note] InnoDB: Shutdown completed; log sequence number 1616707
OK
Filling help tables...
160725 17:21:41 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 2621 ...
160725 17:21:41 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160725 17:21:41 [Note] InnoDB: The InnoDB memory heap is disabled
160725 17:21:41 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160725 17:21:41 [Note] InnoDB: Memory barrier is not used
160725 17:21:41 [Note] InnoDB: Compressed tables use zlib 1.2.8
160725 17:21:41 [Note] InnoDB: Using Linux native AIO
160725 17:21:41 [Note] InnoDB: Using CPU crc32 instructions
160725 17:21:41 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160725 17:21:41 [Note] InnoDB: Completed initialization of buffer pool
160725 17:21:41 [Note] InnoDB: Highest supported file format is Barracuda.
160725 17:21:41 [Note] InnoDB: 128 rollback segment(s) are active.
160725 17:21:41 [Note] InnoDB: Waiting for purge to start
160725 17:21:41 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616707
160725 17:21:41 [Note] InnoDB: FTS optimize thread exiting.
160725 17:21:41 [Note] InnoDB: Starting shutdown...
160725 17:21:43 [Note] InnoDB: Shutdown completed; log sequence number 1616717
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h hostname password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/

Code:

root@:/var/lib/mysql# /etc/rc.d/rc.mysqld start
root@:/var/lib/mysql# 160725 17:21:47 mysqld_safe Logging to '/var/lib/mysql/hostname.err'.
160725 17:21:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160725 17:21:47 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

Code:

root@:/var/lib/mysql# /usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
root@:/var/lib/mysql# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")
Enter current password for root (enter for none):


horizn 07-25-2016 11:30 AM

Quote:

Originally Posted by ml4711 (Post 5581062)
You should create the database
this way to get the right permissions.

Code:

mysql_install_db --user=mysql
Cheers

It doesn't work.

Code:

root@:/var/lib/mysql# mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
160725 17:27:44 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 2792 ...
160725 17:27:44 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160725 17:27:44 [Note] InnoDB: The InnoDB memory heap is disabled
160725 17:27:44 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160725 17:27:44 [Note] InnoDB: Memory barrier is not used
160725 17:27:44 [Note] InnoDB: Compressed tables use zlib 1.2.8
160725 17:27:44 [Note] InnoDB: Using Linux native AIO
160725 17:27:44 [Note] InnoDB: Using CPU crc32 instructions
160725 17:27:44 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160725 17:27:44 [Note] InnoDB: Completed initialization of buffer pool
160725 17:27:44 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-25 17:27:44 7f57c70f6780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
160725 17:27:44 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/gtid_slave_pos'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 17:27:44 [ERROR] InnoDB: Tablespace open failed for '"mysql"."gtid_slave_pos"', ignored.
2016-07-25 17:27:44 7f57c70f6780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
160725 17:27:44 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/innodb_index_stats'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 17:27:44 [ERROR] InnoDB: Tablespace open failed for '"mysql"."innodb_index_stats"', ignored.
2016-07-25 17:27:44 7f57c70f6780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
160725 17:27:44 [ERROR] InnoDB: Could not find a valid tablespace file for 'mysql/innodb_table_stats'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
160725 17:27:44 [ERROR] InnoDB: Tablespace open failed for '"mysql"."innodb_table_stats"', ignored.
160725 17:27:44 [Note] InnoDB: 128 rollback segment(s) are active.
160725 17:27:44 [Note] InnoDB: Waiting for purge to start
160725 17:27:44 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616717
ERROR: 1146  Table 'mysql.proc' doesn't exist
160725 17:27:44 [ERROR] Aborting

160725 17:27:44 [Note] InnoDB: FTS optimize thread exiting.
160725 17:27:44 [Note] InnoDB: Starting shutdown...
160725 17:27:47 [Note] InnoDB: Shutdown completed; log sequence number 1616727
160725 17:27:47 [Note] /usr/libexec/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /var/lib/mysql that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

root@:/var/lib/mysql# /usr/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf
bash: /usr/bin/scripts/mysql_install_db: No such file or directory
root@:/var/lib/mysql# mysql_install_db --defaults-file=~/.my.cnf
Could not open required defaults file: /root/.my.cnf
Fatal error in defaults handling. Program aborted
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
Could not open required defaults file: /root/.my.cnf
Fatal error in defaults handling. Program aborted

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /var/lib/mysql that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

root@:/var/lib/mysql# /usr/libexec/mysqld --skip-grant --general-log &
[1] 2829
root@:/var/lib/mysql# 160725 17:28:54 [Note] /usr/libexec/mysqld (mysqld 10.0.26-MariaDB) starting as process 2829 ...
160725 17:28:54 [ERROR] Fatal error: Please consult the Knowledge Base to find out how to run mysqld as root!

160725 17:28:54 [ERROR] Aborting

160725 17:28:54 [Note] /usr/libexec/mysqld: Shutdown complete


[1]+  Exit 1                  /usr/libexec/mysqld --skip-grant --general-log


ponce 07-25-2016 11:48 AM

maybe it's because you created the db first with wrong permissions: try removing the db directory and recreate it with the right permissions or change directly its permissions, then start the mysql daemon with the dedicated init script
Code:

rm -fR /var/lib/mysql
mysql_install_db --user=mysql
chmod +x /etc/rc.d/rc.mysqld
/etc/rc.d/rc.mysqld start

instructions are in the dedicated init script itself
Code:

$ head -27 /etc/rc.d/rc.mysqld  | tail -16
# To start MariaDB automatically at boot, be sure this script is executable:
# chmod 755 /etc/rc.d/rc.mysqld

# Before you can run MariaDB, you must have a database.  To install an initial
# database, do this as root:
#
#  mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# will be owned by this dedicated user.  This is important, or else mysql
# (which runs as user "mysql") will not be able to write to the database
# later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
#
# To increase system security, consider using "mysql_secure_installation"
# as well.  For more information on this tool, please read:
#  man mysql_secure_installation


horizn 07-26-2016 02:33 AM

Quote:

Originally Posted by ponce (Post 5581074)
maybe it's because you created the db first with wrong permissions: try removing the db directory and recreate it with the right permissions or change directly its permissions, then start the mysql daemon with the dedicated init script
Code:

rm -fR /var/lib/mysql
mysql_install_db --user=mysql
chmod +x /etc/rc.d/rc.mysqld
/etc/rc.d/rc.mysqld start

instructions are in the dedicated init script itself
Code:

$ head -27 /etc/rc.d/rc.mysqld  | tail -16
# To start MariaDB automatically at boot, be sure this script is executable:
# chmod 755 /etc/rc.d/rc.mysqld

# Before you can run MariaDB, you must have a database.  To install an initial
# database, do this as root:
#
#  mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# will be owned by this dedicated user.  This is important, or else mysql
# (which runs as user "mysql") will not be able to write to the database
# later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
#
# To increase system security, consider using "mysql_secure_installation"
# as well.  For more information on this tool, please read:
#  man mysql_secure_installation


Thanks, it worked.

vectrum 11-25-2021 12:28 PM

Thank you very much, Ponce
 
Quote:

Originally Posted by ponce (Post 5581074)
maybe it's because you created the db first with wrong permissions: try removing the db directory and recreate it with the right permissions or change directly its permissions, then start the mysql daemon with the dedicated init script
Code:

rm -fR /var/lib/mysql
mysql_install_db --user=mysql
chmod +x /etc/rc.d/rc.mysqld
/etc/rc.d/rc.mysqld start

instructions are in the dedicated init script itself
Code:

$ head -27 /etc/rc.d/rc.mysqld  | tail -16
# To start MariaDB automatically at boot, be sure this script is executable:
# chmod 755 /etc/rc.d/rc.mysqld

# Before you can run MariaDB, you must have a database.  To install an initial
# database, do this as root:
#
#  mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# will be owned by this dedicated user.  This is important, or else mysql
# (which runs as user "mysql") will not be able to write to the database
# later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
#
# To increase system security, consider using "mysql_secure_installation"
# as well.  For more information on this tool, please read:
#  man mysql_secure_installation


Just believe me! A million thanks won't suffice. I was about to give up after straight nine hours, then I found your post and it seems unbelievable to see mysqld is running. It's happened simple because of you. Also the question was a tailor made for me. :hattip:


All times are GMT -5. The time now is 05:57 AM.