MySQL 5.5.9 Wont Start - mysql

I installed mysql version 5.5.9 on my mac and I tried to start it using this command :
sudo /usr/local/mysql/support-files/mysql.server start
mysql didn't start with this command. I checked the localhost.err file in data directory and it was like this :
110227 22:51:14 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
110227 22:51:14 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
110227 22:51:14 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
110227 22:51:14 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110227 22:51:14 InnoDB: The InnoDB memory heap is disabled
110227 22:51:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110227 22:51:14 InnoDB: Compressed tables use zlib 1.2.3
110227 22:51:14 InnoDB: Initializing buffer pool, size = 128.0M
110227 22:51:14 InnoDB: Completed initialization of buffer pool
110227 22:51:14 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110227 22:51:14 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110227 22:51:15 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110227 22:51:15 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
110227 22:51:15 InnoDB: Waiting for the background threads to start
110227 22:51:16 InnoDB: 1.1.5 started; log sequence number 1595916
110227 22:51:16 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-locking'
110227 22:51:16 [ERROR] Aborting
110227 22:51:16 InnoDB: Starting shutdown...
110227 22:51:16 InnoDB: Shutdown completed; log sequence number 1595916
110227 22:51:16 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
110227 22:51:16 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.pid ended
I deleted the two ib_log files, I changed my.cnf file and I got nothing.

--skip-locking was removed in MySQL 5.5. See here.
Edit your my.cnf file and change "skip-locking" to "skip-external-locking".

I had this same issue on mac, I have other MySQL instances installed from MAMP and XAMP.
Do a locate in terminal: locate my.cnf
Take note of any other my.cnf files not located in your AMPPS directory.
I found that when i removed /private/etc/my.cnf, MySQL started with no issues.
sudo mv /private/etc/my.cnf /private/etc/my-old.cnf

1 ) in the terminal , launch command : mysql_upgrade ( to create the tables that are non existent )
2 ) edit /etc/my.cnf , comment out the --skip-locking statement
that's all , happy SQLing

Related

MySQL Daemon failed to start Linux

I have googled a lot about this issue though there are some solution available however I tried all of them and seems that my issue is slightly different.
Can someone pls help me resolve this.
OS: OEL6.5 Linux
MySQL 5.5
MySQL.log:
180625 12:03:50 [Note] Plugin 'FEDERATED' is disabled.
180625 12:03:50 InnoDB: The InnoDB memory heap is disabled
180625 12:03:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180625 12:03:50 InnoDB: Compressed tables use zlib 1.2.3
180625 12:03:50 InnoDB: Initializing buffer pool, size = 15.0G
180625 12:03:52 InnoDB: Completed initialization of buffer pool
180625 12:03:52 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
180625 12:03:52 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Error: trying to add tablespace 2113 of name './items_table.ibd'
InnoDB: to the tablespace memory cache, but tablespace
InnoDB: 2113 of name './customer_table.ibd' already exists in the tablespace
InnoDB: memory cache!
Important:
Before starting to play with db files make a dump (mysqldump -A > mydb.sql).
Consider following one of the options below:
Moving items_table.ibd out from the directory tree and restarting mysql will fix the Error.
Recreate MySQL data dir: https://dba.stackexchange.com/questions/103625/how-to-reinitialise-var-lib-mysql-files

MYSQL can't run in MAMP on mac after osx buitin upgrade php to 7.1

I have got this error logs after upgrade builtin PHP to version7.1 but I not mean from this cause.
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./shopping/migrations.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
161006 20:08:24 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
161006 20:15:32 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql56
2016-10-06 20:15:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-10-06 20:15:32 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.6.28) starting as process 8447 ...
2016-10-06 20:15:32 8447 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql56/ is case insensitive
2016-10-06 20:15:32 8447 [Note] Plugin 'FEDERATED' is disabled.
2016-10-06 20:15:32 8447 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-06 20:15:32 8447 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-06 20:15:32 8447 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-06 20:15:32 8447 [Note] InnoDB: Memory barrier is not used
2016-10-06 20:15:32 8447 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-06 20:15:32 8447 [Note] InnoDB: Using CPU crc32 instructions
2016-10-06 20:15:32 8447 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-10-06 20:15:32 8447 [Note] InnoDB: Completed initialization of buffer pool
2016-10-06 20:15:32 8447 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-06 20:15:32 8447 [Note] InnoDB: The log sequence numbers 1802852 and 1802852 in ibdata files do not match the log sequence number 1804211 in the ib_logfiles!
2016-10-06 20:15:32 8447 [Note] InnoDB: Database was not shutdown normally!
2016-10-06 20:15:32 8447 [Note] InnoDB: Starting crash recovery.
2016-10-06 20:15:32 8447 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-10-06 20:15:32 8447 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/slave_master_info uses space ID: 4 at filepath: ./mysql/slave_master_info.ibd. Cannot open tablespace shopping/migrations which uses space$
2016-10-06 20:15:32 7fff7b87b000 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./shopping/migrations.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
161006 20:15:32 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
I had the same issue after upgrading from MAMP 3.x to 4.x
I just went to:
edit template in mamp pro and edited the my.cnf template. I added just this line to the file:
innodb_force_recovery = 1
now everything is working and mysql is starting again.

Moving MySQL data to another drive

I want to move my data in C:\ProgramData\MySQL\MySQL Server 5.5\data to E:\Mysql5Data
Stopped MySQL5 Service
Changed "datadir" value in my.ini file to E:/Mysql5Data
Started MySQL5 Service
I got 1067 Process terminated unexpectedly error while starting MySQL.
Update:
Logs
160509 13:18:56 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.5\data\DGNLWEBBIP01.lower-test
160509 13:18:56 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.5\data\DGNLWEBBIP01.lower-test
160509 13:18:56 [Note] Plugin 'FEDERATED' is disabled.
160509 13:18:56 InnoDB: The InnoDB memory heap is disabled
160509 13:18:56 InnoDB: Mutexes and rw_locks use Windows interlocked functions
160509 13:18:56 InnoDB: Compressed tables use zlib 1.2.3
160509 13:18:56 InnoDB: Initializing buffer pool, size = 128.0M
160509 13:18:56 InnoDB: Completed initialization of buffer pool
160509 13:18:56 InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: File name .\ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
SOLUTION:
Murray's comment

Error Starting MySQL after Crash

I was merrily installing wordpress with MAMP pro when my Mac crashed. Now I cannot start MySql. Most stuff I read online tells me to throw some terminal commands at it, trying to kill the process.
killall -9 mysqld
But terminal report "No matching processes belonging to you were found"
So I have had a look in the log and can see this from the time of the first restart attempt after the crash
150506 21:11:33 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
150506 21:11:33 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
150506 21:11:33 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
150506 21:11:33 [Note] Plugin 'FEDERATED' is disabled.
150506 21:11:33 InnoDB: The InnoDB memory heap is disabled
150506 21:11:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150506 21:11:33 InnoDB: Compressed tables use zlib 1.2.3
150506 21:11:33 InnoDB: Initializing buffer pool, size = 128.0M
150506 21:11:33 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
150506 21:11:33 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
150506 21:11:33 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
150506 21:11:33 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150506 21:11:34 InnoDB: Waiting for the background threads to start
150506 21:11:35 InnoDB: 5.5.42 started; log sequence number 0
150506 21:11:35 [Note] Event Scheduler: Loaded 0 events
150506 21:11:35 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.42' socket: '/Applications/MAMP/tmp/mysql/mysql.sock' port: 0 Source distribution
150506 21:16:44 [Note] /Applications/MAMP/Library/bin/mysqld: Normal shutdown
So Table Space size error.. I am very much a front end guy and have no idea where to begin with this...??
Help please, I really can't afford to loose the last week of work.
Thanks you
As you pointed out InnoDB tablespace is corrupt, so InnoDB fails to start.
InnoDB can tolerate some errors if you start it with option innodb_force_recovery. Try values from 1 to 6 until MySQL starts.
If you're lucky and MySQL starts with innodb_force_recovery then dump all tables into an sql file with mysqldump and re-create MySQL database from scratch. I.e. move existing files to some safe place, start mysql_install_db, change file permissions and start MySQL. Then load the database back.
If you're less lucky and MySQL doesn't start with innodb_force_recovery=6 then check how to Recover Corrupt MySQL Database .
And to avoid this experience in future use XtraBackup for Mac OS to take backups.
Please see her:
MAMP PRO crashes; MySQL will not start on reboot
Thanks for the heads up with Xtrabackup for MacOS, one to keep an eye on that.

Can't initiate mysql in MAC OS X 10.7.5

I installed MySQL through a package located in MySQL site.
I changed this directory:
/usr/local/mysql-5.5.28-osx10.5-x86/data
For _mysql
However, when I try to do mysqld start, I get the following errors and warnings:
121018 18:04:17 [Warning] Can't create test file /usr/local/mysql-5.5.28-osx10.5-x86/data/homer.lower-test
121018 18:04:17 [Warning] Can't create test file /usr/local/mysql-5.5.28-osx10.5-x86/data/homer.lower-test
121018 18:04:17 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
121018 18:04:17 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
121018 18:04:17 InnoDB: The InnoDB memory heap is disabled
121018 18:04:17 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
121018 18:04:17 InnoDB: Compressed tables use zlib 1.2.3
121018 18:04:17 InnoDB: Initializing buffer pool, size = 128.0M
121018 18:04:17 InnoDB: Completed initialization of buffer pool
121018 18:04:17 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.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
Any tips on what can be happening?
The easiest thing to do is to install the System Preferences plugin that you get with the download and start/stop MySQL using that. You can set it there to start automatically when the system restarts.