on my dev machine (Ubuntu 20.04, mysql-server 8.0.29-0ubuntu0.20.04.3) my laptop needed to be turned off, and since that mysql does not start.
I've table corruption errors like this:
2022-07-01T12:13:08.666633Z 0 [Warning] [MY-013139] [Server] Cannot load from
mysql.proxies_priv. The table is probably corrupted!
2022-07-01T12:13:08.666748Z 0 [ERROR] [MY-010316] [Server] Fatal error: Could not
read the column 'authentication_string' from table 'mysql.user'. Please perform the
MySQL upgrade procedure.
2022-07-01T12:13:08.666825Z 0 [ERROR] [MY-010952] [Server] The privilege system
failed to initialize correctly. For complete instructions on how to upgrade MySQL to
a new version please see the 'Upgrading MySQL' section from the MySQL manual.
2022-07-01T12:13:08.667187Z 0 [ERROR] [MY-010119] [Server] Aborting
I'd be happy to run mysql_upgrade, however:
The mysql_upgrade client is now deprecated. The actions executed by the upgrade client are now done by the server.
To upgrade, please start the new MySQL binary with the older data directory. Repairing user tables is done automatically. Restart is not required after upgrade.
The upgrade process automatically starts on running a new MySQL binary with an older data directory. To avoid accidental upgrades, please use the --upgrade=NONE option with the MySQL binary. The option --upgrade=FORCE is also provided to run the server upgrade sequence on demand.
It may be possible that the server upgrade fails due to a number of reasons. In that case, the upgrade sequence will run again during the next MySQL server start. If the server upgrade fails repeatedly, the server can be started with the --upgrade=MINIMAL option to start the server without executing the upgrade sequence, thus allowing users to manually rectify the problem.
It seems mysql_upgrade is not supported at this version. What can I do to solve this problem?
Thanks.
https://dev.mysql.com/blog-archive/mysql-8-0-16-mysql_upgrade-is-going-away/ says:
From MySQL 8.0.16 onwards:
Shutdown the server and install the new binaries
Start the server and let the server upgrade the data dictionary tables and system tables.
Read the article I linked to for more details.
You may have to force the MySQL Server to apply the upgrades to tables, by using mysqld --upgrade=FORCE as mentioned in the article. Another user reports having to do that here.
Can I declare lower_case_table_names=1 on my MySql without reinstalling it?
I have a web application that I want to deploy on RHEL based server with MySQL(8.0.18) installed on it. The problem is that I have tested my web apps' sanity on Windows OS with MySQL installed and didn't face any problem. But when I'm running the same on RHEL, MySQL gives me an error while executing queries like 'table USER_MASTER doesn't exist', while it's on my database but with small cases like 'user_master'.
I have done some searching and found that in UNIX case-sensitivity matters while in Windows it doesn't. So I use setting lower_case_table_names=1 in my.cnf and thought this will do the trick but soon I found that this variable must be declared during MySql server initialization time.
I have gone through following liks:
https://mysql.wisborg.dk/2019/04/14/install-mysql-8-on-linux-with-lower_case_table_names-1/
and
https://bugs.mysql.com/bug.php?id=90695
and all these say that I have to reinstall the MySql to make lower_case_table_names works.
Below is the error I get if I use lower_case_table_names=1 directly.
2019-11-08T05:30:17.331505Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0').
I hope there must be some other way by which I can avoid reinstalling the MySql and setting that variable and avoid going through my code and replacing table names with lowercase ones.
Thanks.
No, it is not possible to change this setting on mysql v8.0 without reinstalling it. Mysql manual is very clear on this:
It is prohibited to start the server with a lower_case_table_names setting that is different from the setting used when the server was initialized. The restriction is necessary because collations used by various data dictionary table fields are determined by the setting defined when the server is initialized, and restarting the server with a different setting would introduce inconsistencies with respect to how identifiers are ordered and compared.
This was the answer given to the bug report you linked in as well, so I'm not entirely sure what answer you expected to get here.
I have spent hours trying to get the server running (for the first time), trying many solutions posted online, but to no success.
First time install (Win 7 x64), light remains orage (server offline). If I look at service, the start/resume service remains green:
If I go in services and try start wampmysqld64 service I get this error message:
Here is the Event Viewer Application log (the WAMP mysql log is empty):
Error 11/09/2015 09:04:22 MySQL 100 None Aborting
Error 11/09/2015 09:04:22 MySQL 100 None Unknown/unsupported storage engine: InnoDB
Error 11/09/2015 09:04:22 MySQL 100 None Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Error 11/09/2015 09:04:22 MySQL 100 None Plugin 'InnoDB' init function returned error.
Error 11/09/2015 09:04:22 MySQL 100 None InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
Error 11/09/2015 09:04:22 MySQL 100 None InnoDB: space header page consists of zero bytes in data file .\ibdata1
Warning 11/09/2015 09:04:22 MySQL 100 None InnoDB: Doublewrite does not have page_no=0 of space: 0
I haven't removed/deleted any files, but I did install WAMP server on my D drive (OS on C) due to space limitations).
Installing WAMPServer on the D: drive is just fine.
Possibly somehow these files have been corrupted so try deleting them.
Stop WAMPServer
Delete these files, as this is an initial install they will not have any data in them and the restart of WAMPServer should cause MYSQL to re-create them.
\wamp\bin\mysql\mysql5.6.17\data\ib_logfile0
\wamp\bin\mysql\mysql5.6.17\data\ib_logfile1
\wamp\bin\mysql\mysql5.6.17\data\ibdata1
Now for a little bug fix: Edit \wamp\bin\mysql\mysql5.6.17\my.ini
Find the section marker [wampmysqld] and change it to [wampmysqld64]
Save my.ini
Restart WAMPServer
Also if you are a little short of memory adding this parameter to the my.ini file inside the [wampmysqld64] will reduce the MYSQL memory requirement. Later versions of MYSQL seem to use a hugh amounts of memory ( half a gig ) lots of which is the table_definition_cache for MYISAM files, this will reduce it to something sensible and not effect your use of MYISAM files.
[wampmysqld64]
table_definition_cache = 600
In my case I just had to: edit \wamp\bin\mysql\mysql5.6.17\my.ini and find the section [wampmysqld] and change it to [wampmysqld64].
Then I restarted mysql and it worked!
For me, I realised that I had another MySQL program (from Oracle) installed that was causing a common port-use conflict. Uninstall/disable MySQL server/workbench and other MySQL programs then restart WAMP. This might solve the problem, it worked for me.
I also uninstalled and deleted an old version of WAMP before installing the latest version.
WAMP is a less stable platform. I would suggest XAMPP over WAMP.
It is light compared to wamp-server and much stable than WAMP.
Benefits -
XAMPP is more powerful and resource taking than WAMP.
WAMP provides support for MySQL and PHP.
XAMPP provides support for MYSQL, PHP and PERL
XAMPP also has SSL feature while WAMP doesn't.
If your applications need to deal with native web apps only, Go for WAMP. If you need advanced features as stated above, go for XAMPP.
As of priority, you cant run both together with default installation as XAMPP gets a higher priority and it takes up ports. So WAMP can't be run in parallel with XAMPP.
If mysql service is not starting open my.ini file located at C:\wamp\bin\mysql\mysql[version]\my.ini
Change port number to 3305 at 3 location:
Here:
#password = your_password
port = 3305
socket = /tmp/mysql.sock
Here:
\# The MySQL server
[wampmysqld]
port = 3305
And here:
[mysqld]
port=3305
Now go to C:\wamp\apps\phpmyadmin[version], find config.inc.php and change this line:
$cfg['Servers'][$i]['port'] = '3306';
to this:
$cfg['Servers'][$i]['port'] = '3305';
(3305 being the port you selected previously).
Those steps should get your MySQL running.
I am very new to servers in general and even cmd prompt. Anyways I downloaded MySQL and I am watching this video to set up MySQL at 8:21 in the video is my problem https://www.youtube.com/watch?v=O4xXzTIcnDE. When I type in -intmysql -u root -p i get a warning like this.
[WARNING] TIMESTAMP with implicit DEAULT value is deprecated
I found a few other post that i had to add some timestamp setting to a file. I am running 64 bit so none of these worked. Any ideas on how i can get past this timestamp issue? Thanks.
I don't think that's an error. That's just a warning. You could "turn off" that warning with a startup option (the message lines following the warning at startup tell the setting that needs to be changed...
Those nonstandard behaviors remain the default for TIMESTAMP but as of MySQL 5.6.6 are deprecated and this warning appears at startup:
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use --explicit_defaults_for_timestamp server option (see
documentation for more details).
As indicated by the warning, to turn off the nonstandard behaviors, enable the new explicit_defaults_for_timestamp system variable at server startup. With this variable enabled, the server handles TIMESTAMP as follows instead:
http://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html
The options file is typically named my.cnf file, but on Windows, it may be named my.ini. (So, first, you need to know where the options file is for your installation, and then modify it,
Under the [mysql] section, add explicit_defaults_for_timestamp
[mysql]
explicit_defaults_for_timestamp
That change will become effective the next time MySQL server is started.
If you are loading scripts for tables from older versions of MySQL, those scripts may be dependent on the older, deprecated behavior.
I've installed MySQL on Windows 7. When I'm trying to start MySQL service I'm getting error 1067: The process terminated unexpectedly. Log message:
101111 22:27:11 [Note] Plugin 'FEDERATED' is disabled.
C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Table 'mysql.plugin' doesn't exist
101111 22:27:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: Log scan progressed past the checkpoint lsn 0 37356
101111 22:27:11 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...
InnoDB: Doing recovery: scanned up to log sequence number 0 44233
101111 22:27:11 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
101111 22:27:12 InnoDB: Started; log sequence number 0 44233
101111 22:27:12 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
What can I do about it?
The solution was to install MySQL without spaces in installation path.
Windows 7, 64-bit
One more thing that prevents the mysqld windows service from running is if you have mysqld.exe already running (but not as a service) and occupying port 3306. When the service tries to start and sees that port 3306 is already taken, it fails.
Just open up the windows task manager and look for "mysqld.exe" under the Processes tab. If you see it, kill it and then try to start the service again.
c:\> net start [servicename]
example: c:\> net start MySQL
My issue happened right after a power failure. I got the error 1067 The process terminated unexpectedly. MySQL needless to say did not start. The answer was simple
Open mysql path\data
Remove (delete) both ib_logfile0 and ib_logfile1.
Start the service
The solution to the problem for me was looking in my install directory, finding the /data folder, and copying it's content to the data folder that was specified in my .ini/.cnf configuration file.
I just encountered a similar issue and I found that it is a permission problem. When I copy the database "data", I have to add the permission for "NETWORK SERVICE"
I had the same problem. In my case, it was "user error" (although the Windows installer should have been smarter about it and prevented me from committing such an error).
During installation, if you make changes to the default installation paths, make sure you use the same paths for both the "Server data files" on the Custom Setup screen and then later in the "InnoDB Tablespace Settings" during the "MySQL Server Instance Configuration Wizard"
I had a problem changing the datadir in my.ini for Windows 7.
I wanted the data to be stored on a different drive and I was moving this data from another PC by copying the whole folder. I changed datadir to desired drive and saved the my.ini file with no problems.
But mysql would not start. I opened my.ini file again and it appeared to have been changed.
Then, I noticed the date on the my.ini had not changed. So I had to change the security privileges to give me write access to it.
This time when I saved it, the date changed and mysql started up access to all the correct data.
Before messing with too much things, please check the user the service is trying to run as. In my case it was NETWORK this one did not have write permissions to some locations where it was needed. Changing the user to Local System Account did the trick. If the event viewer shows any error like "Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\XXX.lower-test", there is a high probability for this solution to work.
Good luck!
I have mysql data folder replaced by a windows directory junction.
I suspect ib_logfile0/1 and/or ibdata1 is corrupted.
Just try to delete those files and computername.err. Then restart mysql service.
That's what I did, with success.
Copying ibdata1 files, after a full reinstallation of mysql, to the junction dir and replacing dir by the junction, restarting mysql, was not enough.
You have to let mysql rebuild those files.
Also check if all dirs which you wrote in the my.ini exists.
My problem was that tmpdir doeesn`t exist so MySQL daemon falls with error 1067.
[mysqld]
port= 3306
tmpdir = "C:/tmp"
In this case C:/tmp must exists.
Check the file "C:\Program Files\MySQL\MySQL Server 5.1\my.ini"
The datadir line in my.ini should specify a path. Check the contents of that datadir path. Does it contain a folder named "mysql" and another folder named "test"?
If not, here are two choices:
Change the datadir line in my.ini to the correct location. This will probably be C:\ProgramData\MySQL\MySQL Server 5.1\data
Clean out the existing contents of your datadir path. Copy the contents of the C:\ProgramData\MySQL\MySQL Server 5.1\data to your datadir path. Restarting the mysql service should rebuild your empty database.
In my instance it had nothing to do with spaces in the file name. I used the MSI installer custom configuration and opted to exclude the default databases, assuming it was just something like Northwind/Adventureworks. Nope, it includes the core MySql system database... once I added that to the installation it worked.
in my case innodb_data_home_dir was no longer correct because I had shuffled some drive letters around when I added a new drive to my system
In my case, I have unzipped XAMPP ina a second disk on my installation, "F". When I tried to start as a service, the return was "1067". The solution was to edit my.ini, inserting the "f:" drive in the files lines. It solved the problem.
The problem look like there is no data in the directory.
copy at least the mysql directory either from your previous directory or from C:\Program Files\MySQL\MySQL Server 5.5\data .
And then try again.
I had the same error and it was caused by non standard characters in the log files path.
In order to fix that I found my.ini config file (in my case C:\ProgramData\MySQL\MySQL Server 5.6\my.ini) and modified keys slow_query_log_file and log-error.
After that I managed to start MySQL service succesfully.
In my case, I had chosen a custom path for my log-files in the MySQL installer. I had put the log-files in my user-folder C:\Users\%MY_USERACCOUNT%\Documents\mysql-logs, and by default, NETWORK SERVICE (or any other non-administrator useraccount in Windows) does not have access to a user's folder.
I fixed this by changing security options for the log-folder, giving modify rights read/write/modify rights to NETWORK SERVICE.
I also get log with Table 'mysql.plugin' doesn't exist
if install MYSQL Server 5.1 by 'msiexec.exe'
DataDir I put as C:\MYSQL\MySQL_Server_5_1\data\
but to my surprise was create data in a C:\MYSQL\MySQL_Server_5_1\data\data
There are was add word data . So I change my.ini file from
datadir="C:/MySQL/MySQL_Server_5_1/Data/" .
to the
datadir="C:/MySQL/MySQL_Server_5_1/Data/data"
and then I can use
net start MYSQL51
and then mysqld.exe run and appear in a Task Manager
when looked at mysql log (.err file under data folder), i could see the following
21:41:47 UTC - mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
I realized i was starting the service while i plugged usb. To be honest, the problem was resolved after i restarted my machine followed by restarting the service. In addition i removed ib_logfile0 and ib_logfile1 files before my restart. Though the event logger indicated "InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information
Blockquote
about forcing recovery.For more information, see Help and Support Center at http://www.mysql.com", i do not think so because i never changed any configurations.
Experienced the same error, below is the reason and solution that worked for me for mysql-5.7.14-winx64
reason: DATA folder to have some default folders and files which were missing
solution: delete everything from DATA folder, i assume its a fresh installation so backup anything that you need if at all. Then run this from the command prompt and it will create required files and folders
"mysqld --initialize --console"
now run "mysqld" and it should work well.
In my case, I had another MySQL version installed and running.
I found this by going into the mysql_error.log file.
I fix this by going to services and stopping the running MySQL version and setting up to a manual, and starting the mysql needed.
...an old one... anyway I had the same issue with MariaDB
In my case most pathes contain special characters like: #
Wrapping pathes in my.ini in double quotes made the trick - e.g.
datadir="C:/#windata64/db/MariaDB/data"
In my case, in order to delete a heavy schema from mysql server, just went to C:\ProgramData\MySQL\MySQL Server 5.7\Data and deleted relevant folder. But it was not being deleted because mysqld.exe was preventing it. so I stopped mysqld.exe, deleted the folder and then all the schemas went disappeared from the list in mysql workbench. No matter how much I tried to restart mysql service, it didnt unless I restored that folder from junk.
Hope it helps someone who tried the same shortcut as I did.
I run MariaDB (MySQL compatible) on two machines locally. I'm not sure what prompted the error and nothing I tried worked. So I stopped the service, deleted everything in MariaDB's directory (except the data directory) and copied the files from my secondary machine and everything is working well enough as far as I can tell.
For a live server it'd be a bit different and a super-guru might be able to add an insight comment (e.g. something outside of the data directory might have something to do with preventing data corruption or indexes in example?). I would just stop the service and copy the entire directory once every month or so and then start the service again.
I ran into the same errors. Similar approach for me. From what I can tell, there is something weird going on with the reference to the datadir in the my.ini file. Even when I manually edited it I could not seem to have any effect on it, until I blew EVERYTHING AWAY. Wish I had better news...do a DB backup first.
For me the key to getting this to work was:
1) Remove the previous installation from settings->control panel. Restart your machine.
2) Once machine comes back up, forcefully delete the previous installation directory.
[mine is C:\apps\MySQL\MySQLServer-5.5\, as I REFUSE to use c:\program files\..]
3) Forcefully delete the previous datadir directory [mine was c:\data\mysql].
4) Forcefully delete the previous default data directory [C:\Documents and Settings\All Users\Application Data\MySQL].
5) Re-run the install, selected the same installation directory. Skip the instance configurator/wizard at the end of the install.
6) Make sure the ../bin directory gets added to the path. Verify it.
7) Manually run the instance configurator/wizard.
Set the root password, port [3306].
It will try to start it. Again, mine FAILED to start
[duh! nothing new there!!!]
8) Now, manually edit the my.ini file in the install directory, and correct the datadir setting to be [datadir="C:/Data/MySQL/"] MATCH CAPITALIZATION !!!!
9) Verify the service is setup correctly via the command-prompt [sc qc mysql <enter>].
Should look like:
C:\dev\cmdz>sc qc mysql
[SC] GetServiceConfig SUCCESS
SERVICE_NAME: mysql
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : "C:\apps\MySQL\MySQLServer-5.5\bin\mysqld" --defaults-file="C:\apps\MySQL\MySQLServer-5.5\my.ini" MySQL
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : MySQL
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem
10) Copy the contents of the default data-directory created under C:\Documents and Settings\All Users\Application Data\MySQL [basically everything in this directory to your desired data directory c:\data\mysql]. Make sure you get the C:\Documents and Settings\All Users\Application Data\MySQL\mysql directory. This has host.frm file, and others.
You should end up with a directory now of c:\data\MySQL\mysql...
11) Rename the default directory
C:\Documents and Settings\All Users\Application Data\MySQL
To
C:\Documents and Settings\All Users\Application Data\MySQLxxx
So it cannot find it...
12) Say a quick prayer...
13) Give it a kick start from command line with [net start mysql]
That got it working for me...
Best of Luck!
Something I just discovered was that in the setup I choose InnoDB, whereas in fact all my existing databases were in MyIsam format. I uninstalled and then re-installed choosing MyIsam and everything worked just fine.
If you are trying to run MySql on a Windows 10 installation with a GPT partition, please try this:
Todays systems are often running on a disk which is formatted in GPT. This is because Windows 10 needs such a partition to be installed. The problem is that MySql cant deal with this partition style and so it crashes. Here is my workaround:
Create a virtual disk: manual here
Format this VHD with MBR
Install MySql custom on your new VHD (dont forget to create a user for DB)
This should be it! :)
Reference Link:
Issue with MySql installation on Windows 10