5

I am doing a fresh install of MySQL on Fedora 22. After I run mysql_install_db I try to start the daemon using mysqld_safe but it does not work. The system says:

mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

How do I get this to work?

Here are the mariadb.log contents:

mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[Note] /usr/libexec/mysqld (mysqld 10.0.23-MariaDB) starting as process 20443 ...
[Note] InnoDB: Using mutexes to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Memory barrier is not used
[Note] InnoDB: Compressed tables use zlib 1.2.8
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
[ERROR] InnoDB: The system tablespace must be writable!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
[ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
[ERROR] Plugin 'Aria' init function returned error.
[ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
[Note] Plugin 'FEEDBACK' is disabled.
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
[Note] /usr/libexec/mysqld: Shutdown complete
mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

3 Answers3

1

The error says:

The system tablespace must be writable

Please check the permission of the data directory of MySQL

Tom V
  • 15,752
  • 7
  • 66
  • 87
Geetanjali
  • 11
  • 2
1

[ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied") [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode [ERROR] InnoDB: The system tablespace must be writable!

These imply a few potential causes to the issue.

  1. The mysql user is not properly initiated on the host.
  2. The mysql user does not own /var/lib/mysql.
  3. The /var/lib/mysql directory does not have proper permissions for the mysql user.
  4. The /var/lib/mysql directory does not exist and/or is full and therefore unwritable.

Making proper permissions to allow the mysql user to write onto the specified location will allow you to start mysqld_safe (as well as mysqld) successfully, assuming no other outstanding issues are present on the system.

Josh Bonello
  • 600
  • 1
  • 4
  • 15
1

Check permissions of

  • /var/lib/mysql
  • /var/run/mariadb

Those folders have to be owned by mysql user

  • /tmp/ has to be global writable +t

    chmod 777 /tmp/
    chmod +t /tmp/
    chown root:root /tmp/
    
    $ ls -lahd /tmp/
    
    drwxrwxrwt 7 root root 4,0K Okt 28 22:54 /tmp/
    
rubo77
  • 816
  • 2
  • 13
  • 24