In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you what to do with InnoDB:Unable to lock/ibdata1 error when there is a startup error problem in MySQL. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
MySQL Startup Times error in OS X environment:
01603-03T00:02:30.483037Z 0 [ERROR] InnoDB: Unable to lock. / ibdata1 error: 352016-03-03T00:02:30.483100Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
The terminal repeatedly prints the error log above. From the error log, it seems that another mysqld process is occupying the. / ibdata1 file, so use the ps command to see if there is a mysqld process running:
Ps-ef | grep mysqld74 7711 10 8:04 AM? 0grep mysqld74 00.34 / usr/local/mysql/bin/mysqld-- user=_mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- plugin-dir=/usr/local/mysql/lib/plugin-- log-error=/usr/local/mysql/data/mysqld.local.err-- pid-file=/usr/local/mysql/data/mysqld.local.pid
Found that there is a 7711 process running, so force kill to drop:
Sudo kill-9 7711
Ps query again:
Ps-ef | grep mysqld74 7759 10 8:10 a.m.? 0usr/local/mysql/bin/mysqld-- user=_mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- plugin-dir=/usr/local/mysql/lib/plugin-- log-error=/usr/local/mysql/data/mysqld.local.err-- pid-file=/usr/local/mysql/data/mysqld.local.pid
The discovery is still there, but the pid has changed from 7711 to 7759, so take a look at what files the mysqld process has opened:
Lsof-c mysqld
The process did not open any files, which is damned.
Mac OS X, lsof only shows your own processes unless running as root with sudo
So run it again:
Sudo lsof-c mysqldCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEmysqld 8655 _ mysql cwd DIR 1 4 544 3090250 / usr/local/mysql/datamysqld 8655 _ mysql txt REG 1 4 31130736 3089789 / usr/local/mysql/bin/mysqld
It is true that there is a real mysqld process running, and these mysql files are also occupied. After a lot of Google, it is found that starting MySQL in OS X is completely different from starting it in Linux. The correct posture to start / restart MySQL in OS X is:
Sudo launchctl unload-w / Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
At this point, let's see if there are any mysqld processes:
Ps-ef | grep mysqld
Well, if you find that it is really gone, start MySQL again:
Sudo launchctl load-w / Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
The problem is finally solved, but it's not over yet. We have to figure out the principle.
What is LAUNCHD?
Launchd is a key process introduced by Mac OS X since 10.4 to initialize the system environment. It is the first process to be started in the OS environment after the kernel is successfully loaded. Traditional Linux uses / etc/rc.* or / etc/init to manage the services to be started, while in OS X it is managed using launchd. Configuring startup items in this way is simple and requires only a plist file. The plist files in the / Library/LaunchDaemons directory are all processes that start immediately after the system starts. Use the launchctl command to load / unload the plist file, after loading the configuration file, the program starts, and after unloading the configuration file, the program closes.
After uninstalling the configuration file, try starting the mysql process directly with the mysqld command:
/ usr/local/mysql/bin/mysqld2016-03-03T01:35:50.359258Z 0 [ERROR] InnoDB:. / ib_logfile0 can't be opened in read-write mode.2016-03-03T01:35:50.359283Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error2016-03-03T01:35:50.670517Z 0 [ERROR] Plugin 'InnoDB' init function returned error.2016-03-03T01:35:50.670555Z 0 [ERROR] Plugin' InnoDB' registration as a STORAGE ENGINE failed.2016-03- 03T01:35:50.670568Z 0 [ERROR] Failed to initialize plugins.2016-03-03T01:35:50.670574Z 0 [ERROR] Aborting
Ib_logfile0 cannot be opened, guess it is a user rights file, cannot start mysql with the current system user. So add sudo and start it with root:
2016-03-03T01:38:10.977313Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as rootstocks 2016-03-03T01:38:10.977339Z 0 [ERROR] Aborting2016-03-03T01:38:10.977350Z 0 [Note] Binlog end2016-03-03T01:38:10.977410Z 0 [Note] / usr/local/mysql/bin/mysqld: Shutdown complete
Ask me to read the MySQL security manual and start it in the launchd way.
Thank you for reading! This is the end of the article on "how to start the error report in MySQL InnoDB:Unable to lock/ibdata1 error". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.