Why can't I start mysql service on ec2 linux instance

5,125

'./mysql/plugin.frm' (errno: 13 - Permission denied)

Can't create/write to file '/var/tmp/ibdSw66G ... Permission denied'

Try chown mysql.mysql /var/lib/mysql/ -R; chmod 1777 /var/tmp Also, have you read/tried this:

Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

Share:
5,125

Related videos on Youtube

Dave2345
Author by

Dave2345

Updated on September 18, 2022

Comments

  • Dave2345
    Dave2345 over 1 year

    I get this error when starting mysql via ssh on my ec2 ami linux instance:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/libysql/mysql.sock' (2)
    

    Before running "mysql" command i tried to start mysql service:

    sudo service mysqld start
    

    but fails.

    I checked for mysql.sock in the specified directory but it was missing. What is going on?

    EDIT Also i changed permissions to these directories:

    /var/lib/mysql/ => 755
    all sub-directories in /var/lib/mysql => 700
    all files in /var/lib/mysql => 660
    

    EDIT I just uninstalled and re-installed mysql on my redhat ami ec2 instance. And I still can't start mysql service.

    EDIT

    Here is my mysql log:

        170506 04:31:30 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
        2017-05-06 04:31:30 6516 [Note] Plugin 'FEDERATED' is disabled.
        ^G/usr/libexec/mysql56/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
        2017-05-06 04:31:30 6516 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
        2017-05-06 04:31:30 6516 [Note] InnoDB: Using atomics to ref count buffer pool pages
        2017-05-06 04:31:30 6516 [Note] InnoDB: The InnoDB memory heap is disabled
        2017-05-06 04:31:30 6516 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
        2017-05-06 04:31:30 6516 [Note] InnoDB: Memory barrier is not used
        2017-05-06 04:31:30 6516 [Note] InnoDB: Compressed tables use zlib 1.2.8
        2017-05-06 04:31:30 6516 [Note] InnoDB: Using Linux native AIO
        2017-05-06 04:31:30 6516 [Note] InnoDB: Using CPU crc32 instructions
        ^G/usr/libexec/mysql56/mysqld: Can't create/write to file '/var/tmp/ibdSw66G' (Errcode: 13 - Permission denied)
        2017-05-06 04:31:30 7faa567fd840  InnoDB: Error: unable to create temporary file; errno: 13
        2017-05-06 04:31:30 6516 [ERROR] Plugin 'InnoDB' init function returned error.
        2017-05-06 04:31:30 6516 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
        2017-05-06 04:31:30 6516 [ERROR] Unknown/unsupported storage engine: InnoDB
        2017-05-06 04:31:30 6516 [ERROR] Aborting
    2017-05-06 04:31:30 6516 [Note] Binlog end
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'partition'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'ARCHIVE'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_METRICS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_CMPMEM'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_CMP'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_LOCKS'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'INNODB_TRX'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'BLACKHOLE'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'CSV'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'MEMORY'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'MyISAM'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'MRG_MYISAM'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'sha256_password'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'mysql_old_password'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'mysql_native_password'
    2017-05-06 04:31:30 6516 [Note] Shutting down plugin 'binlog'
    2017-05-06 04:31:30 6516 [Note] /usr/libexec/mysql56/mysqld: Shutdown complete
    

    EDIT

    I also fully uinstalled and re-installed mysql with this command couple of times now:

    sudo yum -y remove mysql-server
    sudo yum -y install mysql-server
    

    EDIT

    Alright, forget it...lol. I just started a new amz ec2 linux instance. THanks!

    • Putnik
      Putnik about 7 years
      what's the error message after start? what's in netstat -plnt | grep 3306 ?
    • Admin
      Admin about 7 years
      when i type above command without sudo i get: (No info could be read for "-p": geteuid()=500 but you should be root.). And when i type with sudo, i get nothing, just goes to next commandline.
  • Admin
    Admin about 7 years
    nope still same issue. and telnet is not found a recognized command on my server.
  • Admin
    Admin about 7 years
    tried that, still doesn't work.
  • Kumaresh Babu N S
    Kumaresh Babu N S about 7 years
    @Dave2345 Have you opened inbound traffic for Port 3306?
  • AlexD
    AlexD about 7 years
    The correct permissions for /var/tmp should be 1777.
  • Dave2345
    Dave2345 about 7 years
    Yes, in AWS console I set it.
  • Dave2345
    Dave2345 about 7 years
    I couldn't change permissions/owners of either directories because of "permission denied" error(s).
  • Putnik
    Putnik about 7 years
    @Dave2345 so does it work now?
  • Dave2345
    Dave2345 about 7 years
    no, i just trashed this instance and started another one lol. thanks tho.