3

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
1

The error says:

The system tablespace must be writable

Please check the permission of the data directory of MySQL

| improve this answer | |
  • Checked. Its OK. mysql-server owns the directory. – Ranbir May 5 '16 at 14:11
  • Another permission check: Was mariadb being run as mysql? – Rick James May 5 '16 at 14:45
  • @Computer the mysql user has to own the datadir, its content, and have access to the entire path (all parent dirs of the datadir). Do you maybe have apparmor or selinux active? These like to block mysql from accessing its files. – jkavalik May 5 '16 at 15:41
  • 1
    please provide the output of below command: ls -ld /var/lib/mysql and ls -l /var/lib/mysql – Geetanjali May 9 '16 at 5:35
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.

| improve this answer | |
0

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/
    
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.