I would like to ask a help for the problem I encountered. My mysql server suddenly stopped after I install php-soap. I don't know why it get stopped actually...
Since it's stopped I tried to start it by typing the line:
# /etc/init.d/mysqld start
After this, I get this message:
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
Starting mysql seems failed. Since I tried it numerous times and got this result a numerous time. I checked the mysqlog and here's what I got.
==== MYSQL LOG ====
120511 21:34:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120511 21:34:43 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 481 error messages,
but it should contain at least 641 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146
120511 21:34:43 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
120511 21:34:43 InnoDB: Initializing buffer pool, size = 8.0M
120511 21:34:44 InnoDB: Completed initialization of buffer pool
120511 21:34:44 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: 'open'.
InnoDB: Cannot continue operation.
120511 21:34:44 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Other infos:
OS: CentOS 5.5 64bit
Mysql Version: Sorry I couldn't get the version of mysql installed on my server due this error I am getting:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Can somebody help me to resolve this problem?
Thank you in advanced.
looks like your installation of mysql is not corrupt with /usr/share/mysql/english/errmsg.sys having been modified to contain less than the number of entries needed.
i would get the installation/src files for mysql for your centos box again. Untar it and locate the file errmsg.sys from sql/share/english, copy it to /usr/share/mysql/english/errmsg.sys and restart your mysqld. Another option is just to reinstall mysql from centos repo, after backing up your dbs to make sure they don't get blown away and to have a copy/backup of it.
I would also find out what made the changes to the errmsg.sys file.
Related
By mistake I dropped mysql database which contains configuration for mysql service itself and now the service won't start. Here is the log at startup :
100 200
2018-10-17T06:31:21.364556Z 0 [Warning] InnoDB: New log files created, LSN=2939944
wampmysqld64: Table 'mysql.plugin' doesn't exist
2018-10-17T06:31:21.748646Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2018-10-17T06:31:21.749764Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-10-17T06:31:21.754394Z 0 [Warning] Failed to open optimizer cost constant tables
2018-10-17T06:31:21.803432Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2018-10-17T06:31:21.804295Z 0 [ERROR] Aborting
Is there a way to restore it to the original without reinstalling everything (it was bundled in wamp server so I would have to reinstall everything).
To restore fresh mysql system after accidental removal of a system database you have to :
Rename or delete the data folder in mysql install folder otherwise the next step will yield an error.
Run one of these commands from windows console :
C:> bin\mysqld.exe --initialize
C:> bin\mysqld.exe --initialize-insecure
I know there are countless questions and posts about this, but I'm getting an error when trying to start the MySQL Server and I don't know how to solve it.
So to explain I cannot access my database so I tried to reset the password of the root user. I've followed this guide however I've had no luck. First I had issues with permissions on my machine and now I'm getting this error:
1105 Bootstrap file error, return code (0). Nearest query: ''
Technically the MySQL Server is starting, however the init-file is not being run, and so my password is not being reset.
Command I am running is this:
mysqld --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 5.7\\my.ini" --init-file=C:\\mysql-init.txt --console
Contents of mysql-init.txt
ALTER USER 'root'#'localhost' IDENTIFIED BY 'new_password';
The following is the part of the log where the error is shown:
[Note] Execution of init_file 'C:\\mysql-init.txt' started.
[ERROR] 1105 Bootstrap file error, return code (0). Nearest query: ''
[Note] Execution of init_file 'C:\\mysql-init.txt' ended.
[Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: ready for connections.
MySQL Version: 5.7
OS: Windows 10
Actually you can pass the command:
--init-file=C:\\mysql-init.txt
as a parameter to start the MySQL service from its general tab.
(Source)
Had two errors with MySQL 5.7.24
1.) The script file must be in a separate folder (not mysql installation folder or data directory)
and that folder must get "secure-file-privileges"
2.) The error above was raised for the script did not end with a ';'
Succeeded then with command line statement as
mysqld --datadir=D:\ProgramData\mysql\data --init-file=D:\ProgramData\mysql\reset\reset.sql --secure-file-priv=D:\ProgramData\mysql\reset --console
and SQL-script file 'reset.sql' as
alter user 'root'#'localhost' identified by 'root_pwd';
For me, on Ubuntu, problem was init file was not owned by mysql user.
chown mysql:mysql /tmp/reset_mysql_pswd.sql
sudo mysqld --init-file=/var/lib/mysql/reset_mysql_pswd.sql
# ^C or kill -9 <mysqld pid>
systemctl stop mysql.service
systemctl start mysql.service
Even when the folder containing the init file and the init file itself had permissions 777 (which is a bad idea), I still get:
2020-04-10T23:14:48.030719Z 0 [Note] Execution of init_file '/tmp/reset_mysql_pswd.sql' started.
2020-04-10T23:14:48.030764Z 0 [ERROR] mysqld: File '/tmp/reset_mysql_pswd.sql' not found (Errcode: 13 - Permission denied)
2020-04-10T23:14:48.030772Z 0 [ERROR] Aborting
I´ve installed mysql and it worked fine.
Now I´d liked to have the data of several databases in my dropbox. So I put symlinks in my mysql data dir.
sudo ln -s /Users/michaelbenker/Dropbox/geschaeft/softwareentwicklung/DB/testdatabase /usr/local/mysql/data/testdatabase
Now when I tried to restart mysql, I get the error
ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file
(/usr/local/mysql/data/Michaels-iMac-783.local.pid).
In my error file I found this entry
2017-05-26T11:29:12.067923Z 0 [ERROR] InnoDB: Operating system error
number 13 in a file operation.
2017-05-26T11:29:12.067928Z 0 [ERROR] InnoDB: The error means mysqld
does not have the access rights to the directory.
2017-05-26T11:29:12.067934Z 0 [ERROR] InnoDB:
os_file_readdir_next_file() returned -1 in directory ./, crash recovery
may have failed for some .ibd files!
2017-05-26T11:29:12.067963Z 0 [ERROR] InnoDB: Plugin initialization
aborted with error Generic error
2017-05-26T11:29:12.375057Z 0 [ERROR] Plugin 'InnoDB' init function
returned error.
2017-05-26T11:29:12.375090Z 0 [ERROR] Plugin 'InnoDB' registration as a
STORAGE ENGINE failed.
2017-05-26T11:29:12.375097Z 0 [ERROR] Failed to initialize plugins.
2017-05-26T11:29:12.375100Z 0 [ERROR] Aborting
So I tried several things to change the permission to my Dropbox data-dir
I tried to change the owner to mysql (tried also _mysql)
I tried to change the group to mysql (tried also _mysql)
I tried to change the chmod to 777
Nothing helped.
I did the same on my MacBook and here everything worked fine.
Here the actual permissions on the Dropbox Dir
drwxrwxrwx# 5 _mysql _mysql 170 26 Mai 13:02 DB
MySQL will also need to be able to change into the parents of the Dropbox directory, which implies a +x on each one.
I use the command:
/usr/local/Cellar/mysql/5.6.26/support-files/mysql.server start
to start the database and get the error info:
ERROR! The server quit without updating PID file(/usr/local/var/mysql/macbooks-MacBook-Pro.local.pid).
The local.err has the following information:
151103 20:43:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2015-11-03 20:43:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-03 20:43:37 0 [Note] /usr/local/Cellar/mysql/5.6.26/bin/mysqld (mysqld 5.6.26) starting as process 42772 ...
2015-11-03 20:43:37 42772 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-03 20:43:37 42772 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/Cellar/mysql/5.6.26/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2015-11-03 20:43:37 42772 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Your MySQL installation appears to be damaged. You have an error but the proposed resolution isn't likely to help:
/usr/local/Cellar/mysql/5.6.26/bin/mysqld: Can't find file: './mysql /plugin.frm'
(errno: 13 - Permission denied)
2015-11-03 20:43:37 42772 [ERROR] Can't open the mysql.plugin table.
Please run mysql_upgrade to create it.
As you see, MySQL cannot open a file, but not because it does not exist; rather because it has no rights to do so (error 13).
From the console, verify the status of the mysql/plugin.frm file in the 'mysql' directory. You'll need to find the MySQL data directory (mysql).
Supposing it's /usr/local/var/mysql/, you would do
ls -la /usr/local/var/mysql/ | more
(SPACE or ENTER to page the output) and see a row containing "plugin.frm".
If there is not, then running the mysql_upgrade command might fix things (but backup the mysql installation and data directory first! Just in case).
If there is, verify it has the same user and group as the other files. Chances are that the other files will be owned by Cellar/users and this, maybe, by root/wheel. As administrator (su), try running
chown Cellar:users ./mysql/plugin.frm
and this should fix the Errno 13, and possibly the PID trouble as well.
Failing everything else, reinstalling MySQL could be a solution. You'll install the same version 5.6.26, then verify the data directory and, if necessary, overwrite it with your backup, having care to preserve the new ownerships and permissions.
This trick isn't guaranteed to work between different MySQL versions and OSes, but on the same machine with the same MySQL version and OS it stands excellent chances.
You can also run a partial restore of only the databases you need (for example you can skip restoring the mysql tablespace where all users and permissions are. You'll lose them, but the data will still be accessible in the other databases).
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Since two days, I can't connect to mysql with my root account.
I have no problem to log in with the other accounts.
I first thought my server was hacked and that somebody changed the password. I tried to reset it. To do so, I had to use mysqld_safe and therefore to stop mysql, that I failed to do:
> sudo /etc/init.d/mysql stop
Stopping MySQL database server: mysqld failed!
> mysqld stop
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
130107 13:48:34 InnoDB: Unable to open the first data file
[...]
InnoDB: Error in opening ./ibdata1
130107 13:48:34 InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.1/...ror-codes.html
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
130107 13:48:34 [ERROR] Plugin 'InnoDB' init function returned error.
130107 13:48:34 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mysqld: Too many arguments (first extra is 'stop').
MySQL couldn't read ibdata1, so I check its permissions that looks correct:
> ls -l /var/lib/mysql/
-rw-rw---- 1 mysql mysql 18874368 Jan 7 12:39 ibdata1
-rw-rw---- 1 mysql mysql 5242880 Jan 7 13:05 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Jan 7 13:05 ib_logfile1
I tried to move and copy the file like explained here, without any success:
> mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.bak
> cp -a /var/lib/mysql/ibdata1.bak /var/lib/mysql/ibdata1
Here is a part of my.cnf
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
LANGUAGE = /usr/share/mysql/english
skip-external-locking
The datadir is correct.
As well, here is what happens when I try to get MySQL status:
# sudo /etc/init.d/mysql status
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'#'localhost' (using password: YES)'
I found a solution to this problem on this page, but I have to log in as a root user to do so, that I can't do. I guess the two problems are linked.
Does anyone of you knows how to fix this? I'm blocked in my work because of this.
Thank you a lot for reading this message and maybe to reply to it.
Have a nice day!