I see from reading around this is a very common problem and there are 2 recommended main solutions:
clear the temp files; and
check if another instance of MySQL is running.
Solution 1 - Clear files
I have cleared ib_logfile0, ib_logfil1 and iddata1. When I restart MAMP, it recreates these files but the server does not start.
Solution 2 - Close other instances of MySWL
I am unable to find a way to check if MySQL is already running else where. Reading around (inc MAMP help site), I should use Window task manager to search for "MySQLd" and close any instances that are running, however Win10 seems to have delete the search function from the task manager. A look through the processes did not show any though:
screen shot of windows task manager
Next I have seen people adding "innodb_force_recovery = 1" to my.cnf file. I searched for my.cnf but couldn't find it. Instead I tried adding the line to C:\MAMP\conf\mysql\my.ini and I also tried adding "innodb_force_recovery = 2". Neither worked.
I tried changing the port number that MySQL uses to 3307, that didnt work either.
Finally, I uninstalled and re-installed MAMP - didn't work.
The MySQL error log reads:
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
[Note] C:\MAMP\bin\mysql\bin\mysqld.exe (mysqld 5.7.24-log) starting as process 9044 ...
I think it would be useful if there is a way to check for instances of MySQL running via the command line, and then if they is one, how to close it from the command line.
Following steps fixed my issue
1. Stop your MAMP Server.
2. Find the db folder for mysql. In my case: C:\MAMP\db\mysql
3. Rename the mysql-bin.index file to mysql-bin_old.index
4. Start your MAMP Server
This question has been answered here:
MySQL Server on MAMP-Windows Will Not Start
The fix posted by this user apparently comes from MAMP support. My problem was identical to yours and it worked for me. The issue related to binary logging, which can be disabled in a configuration file.
Good luck.
This is what worked for me :
Click on Start Servers in MAMP
Manually click on mysql.exe in MAMP installation folder
C:\MAMP\bin\mysql\bin\mysql.exe
Related
I've been running without any problem Wordpress locally on my W10 x64 PC for over a week.
I turned on my computer this morning, opened XAMPP 3.2.4 and I am unable to start the MySQL module.
"Error: MySQL shutdown unexpectedly."
At first it says:
16:25:35 [mysql] Attempting to start MySQL service... 16:25:35
[mysql] Status change detected: running
And then this:
16:25:43 [mysql] Error: MySQL shutdown unexpectedly.
I tried changing port, reinstalling services, removing some files in the MySQL data folder (trying to follow the online guides about problems similar to mine) but nothing worked.
When I manually try to start the MySQL service I get the error 1067.
I uploaded the error log file here:
https://drive.google.com/file/d/1q-wQm5a5uChF6_6UCsfVEBFoeSvKwh2E/view?usp=sharing
It seems that you have your first warning at:
2019-11-13 14:00:05 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1932: Table 'mysql.gtid_slave_pos' doesn't exist in engine
Do you have a replication schema woriking? if not, you can rename master.info files to avoid replication.
Besides that you have your first error related to files access:
2019-11-13 14:10:32 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\virtualnordicdb\wp_commentmeta.ibd' OS error: 203
Can you access that file and the file has correct the write/read privileges
And Finally you have space enough in your hard drive?
019-11-13 14:20:25 0 [Note] mysqld.exe: Aria engine: starting recovery
recovered pages: 0% 10%191113 14:20:26 [ERROR] mysqld got exception 0xc0000005 ;
I was able to fix this by unistalling and reinstalling XAMPP.
I then copied the website folder back in htdocs, and finally went to "mysql>data", copied the database folder of the website and pasted the "ibdata1" file that I had before reinstalling XAMPP.
I came up with this solution thanks to this answer on another post:
https://stackoverflow.com/a/50855748/12367579
I have been to this problem thousands of times.
This problem is related to some custom things such as other programs or duplication.
I can give you several solutions:
Check Control Panel
Maybe you have installed your Xampp several times. Go there and check on the bottom. If there are too many Xampp installs, uninstall them all. Don't forget to save your xampp folder with htdocs and mysql.
Check your programs installed on pc
There are too many suspicious programs like Teamviewer or VMWare that block the port of mysql. Try to uninstall it, and install them again after finishing work with your Xampp.
Changing the port
Go to XAMPP Control Panel and near to MYSQL go to Config > my.ini
Search for port=3306, and replace all occurrences' values with 3336.
After that, go to CONFIG at the top on the right, then to Service and Port Settings, after it at MYSQL tab.
On that tab change the value of port to 3336.
After that click save and then quit your XAMPP.
I'm attempting to update some variables for my MySQL database server; I am running Maria version 10.3.12 on a Windows 10 64-bit laptop. I have attempted to update the my.ini file located here:
C:\Program Files\MariaDB 10.3\data\my.ini
I am adding the following lines to a rather simple my.ini
max_allowed_packet=64M
interactive_timeout=86400
wait_timeout=86400
I have saved the changes to the my.ini; but when I restart the database server using mysqld restart at the command console, and then log back into the client, I expect to see my changes using SHOW VARIABLES LIKE 'max%' and what I end up seeing is the default value. The default value for max_allowed_packet is about 16M and for the other two it is 28800.
There are numerous articles that relate to this; having poured over them I am aware of how to use the SET command to update these from within the client. My goal though is to make a permanent change.
I have no doubt I have overlooked something; any feedback is appreciated.
You can identify path of the configuration file by looking into services:
Open services and find MariaDB Service instance
Right click and click on Properties
You should see something like "C:\path\to\exe" --defaults-file="c:\path-to-ini\my.ini"
then you can edit correct configuration file
I found the solution. After making the changes noted in my post I was attempting to restart MySQL daemon using the Windows Command line and the following command:
C:\Users\david>mysqld restart
2019-03-14 21:05:48 0 [Note] mysqld (mysqld 10.3.12-MariaDB) starting as process 8548 ...
The results can be seen below the command which is mysqld restart
MySQL being installed and run as a Service, clearly this was not the was to restart it; so I restarted it using the Services.msc:
Typing Services.msc into the search bar
Selecting Services
In the Services app find MySQL
Right clicking MySQL and selecting
Restart
This caused the my.ini file to be reread.
Beginning configuration step: Initializing Database
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.11...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-06-26T08:44:42.036600Z 0 [ERROR] [MY-011071] [Server] Unknown suffix '.' used for variable 'lower_case_table_names' (value '0.0')
2018-06-26T08:44:42.036600Z 0 [ERROR] [MY-011071] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'
2018-06-26T08:44:42.036600Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-06-26T08:44:42.036600Z 0 [Note] [MY-010120] [Server] Binlog end
Process for mysqld, with ID 3232, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.11.
Database initialization failed.
Ended configuration step: Initializing Database
I am having this error in log during the installing of MySQL on the application configuration part.
Resolved following these steps:
- Rollback installation until initial page and choose remove mysql server
- Uninstall from add/remove programs mysql community installer
- reboot
- install version mysql-installer-web-community-5.7.22.1 and select update when it asks.
- done
This is a Bug in the Installer of 8.0.11.
There are changes in the lower_case_table_names variable in the new release. See:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html
Nobody can fix this. If you installing the Server the configfile is write before new. Every time. So if you fix this 0.0 to 0 in my.ini the changes will be overwritten.
Somebody have to report a this bug to MySql.
EDIT:
I have report a bug to oracle:
https://bugs.mysql.com/bug.php?id=91539
The only way to get rid of this error is by allowing MySQL Installer to update when it prompts to do so at the beginning of the installation. Please note that you will get this error if you didn't allow the installer to update.
Updating lower_case_table_names = 0 in my.ini doesn't fix this because MySql will re-initialize it to 0.0 everytime before running the scripts.
If you didn't allow updates, you will need to uninstall all components of MySql and run the installer again and let it update.
First you have to uninstall mysql:
Step 1. control panel->programs and then uninstall whole mysql.
Step 2. delete folder MySQL from the following path.
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\ProgramData\MySQL (your programdata folder is hidden so you have to unhide from c drive->views->options->view ->show hidden files)
4.C:\Users\hp(your pc name)\AppData\Roaming\MySQL
Step 3. windows+r write regedit.exe enter and follow the path and delete mysql Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\
Step 4. control panel->administrative tool->services then find mysql copy name then open cmd run as administrative write (sc Delete "mysql name that you copied")enter.
Now you can install MySQL
Update the installer for mysql-installer-web-community-5.7.22.1 file during the installation from the web . I encountered the same problem, after updating the installer it works correctly.
When I downgrade MySQL from 8.0.11 to 5.7.22, I encountered this error. Spend a lot of time to fix the bug. Finally, I fix this problem by the following steps:
uninstall all the related features with MySql( use Control Panel > Programs and Features)
go to C: drive, make all hidden files visible(view > hidden items), find ProgramData file
delete the MySql file inside hidden ProgramData file manually.
Make sure all the MySQL files are deleted, reinstall MySQL. It works for me. I successfully installed MySQL 5.7.22 without any problem.
My Guess: This error probably will happen if you are second or third time to install MySql server. It seems like the error happens because the old MySql files are not deleted completely. Usually, we all think that after we uninstall the application, the files are deleted from program files, it is clean, everything was done. However, there still some files hidden from us. We have to delete them by ourselves.
On bug page, last comment states that the latest installer solves this problem.
For me not. The following steps made me a clean install (after get the latest installer):
When it fails on database initialization step just cancel it back to the installer's main page where you can see installed MySQL server with a reconfigure option.
Now edit the my.ini and set the
"lower_case_table_names=0.0"
to
"lower_case_table_names=0"
Click on reconfigure and now it goes over on this problem.
Hope it helps.
I faced the same problem with 1.4.25 installer and resolved that by doing the following steps [without updating the installer]
There is a folder MySQL Installer for Windows\Manifest\Templates
In Templates folder there are few text files which are there to be used as a template during my.ini generation. I have commented out the line lower_case_table_names=
Now I execute the configuration process using installer and it executes without any error.Also I add the variable later and restart the server.
As the bug reported in https://bugs.mysql.com/bug.php?id=91476, upgrade MySQL installer to 1.4.26.0 and reinstall MySQL server would resolve the issue.
When I installed mysql server, wizard of installation was stooped at the point initializing database (if necessary) for that I did.
remove mysql folder from 'C:\ProgramData' folder. Note: ProgramData is hidden. You need to make it visible.
Uninstall mysql server if it was in the list of installed programs in control panel.
Download mysql-installer-web-community-8.0.13.0 and install it again.
I had the same problem, tried to change my.ini did't work, so I uninstalled the SQL server, then I google my operating system + Install MySQL videos (In my case "Install MySQL on Windows 8"), then I installed MySQL 5.6.26 then worked.
I think the newer MySQL doesn't support certain old operating system.
I am a SQL Server guy and have only recently decided to venture into the world of MySQL and have run into an issue that is preventing me from progressing :(
I have installed MariaDB and started testing the installation by running
mysqld.exe --console
and received the following error
[ERROR] InnoDB: .\ibdata1 can't be opened in read-write mode
I have done quite a bit of research on this and have not found a solution that works.
I have tried the following:
Checked the user permissions for the containing folder of ibdata1 which is located at C:\Program Files\MariaDB 10.1\data and everything looks correct.
I have tried deleting the ibdata1 and log files from the above location, stopping mysql and restarting.
I have tried repairing the application.
I have tried uninstalling and reinstalling.
None of these have worked.
Please let me know if you have any information that might help me.
This is on Windows 8, MariaDB version 10.1.13.
Thanks!
You're running MariaDB from the console interactively, which means you're running it under your local user account security context. I'm guessing the command-prompt window was not elevated first, so your security level will not grant you access to write to anything under %programfiles%.
There are two options:
Change your MariaDB configuration to store the file under %ALLUSERSPROFILE% (which is C:\ProgramData on Windows 8) or your local user account.
Run MariaDB as a background service with its own user-account (a service-identity, perhaps, if you're comfortable with that, otherwise a normal user account) with appropriate permissions.
Out of curiosity, why are you running Windows 8 instead of Windows 8.1?
MariaDB MSI installs datadirectory under C:\Program Files\MariaDB ...\data (not that different from SQLServer , where data directory is also under the installation root). During the installation you were asked if you want to install as service. Say "yes" to this, and then you won't need to start mysqld on the console window, it is already there, running as service.
Perhaps this service is already running , and thus second attempt to open the files (when you run mysqld --console) does not succeed.
I need some help here to understand installing and initializing MySQL on my local Macbook. First I have installed MySQL using the DMG file and everything looks like it worked fine. I even tried doing some basic hello-world type of activities on the database to get a feel of it.
Then next I came across this page in the documentation that explained the process of initializing the data directory. I got really puzzled, and just decided to uninstall MySQL following the instructions here and go through the whole installation process again. My goal for doing so was so that I could follow the initialization instructions as stated in the documentation before I started using the database, unlike in the first time round, where I started using it before I had initialized.
I found the process of initialization to be quite tricky and confusing. As I was at the step running the command
shell> bin/mysqld --initialize --user=mysql
the errors popped up
2016-01-17T17:28:21.145457Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-17T17:28:21.162124Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-01-17T17:28:21.162188Z 0 [ERROR] Aborting
and then I another part of the documentation entitled Initializing the Data Directory Manually Using mysql, that accounted for this error and actually said:
If a data directory exists and is not empty (that is, it contains files or >subdirectories), the server exits after producing an error message:
[ERROR] --initialize specified but the data directory exists. Aborting.
In this case, remove or rename the data directory and try again.
As of MySQL 5.7.11, an existing data directory is permitted to be nonempty >if every entry either has a name that begins with a period (.) or is named >using an --ignore-db-dir option.
So that was what I did and I could proceed with the initialization. After that I continued with starting up the server normally,
After you initialize the data directory by starting the server with -->initialize or --initialize-insecure, start the server normally (that is, >without either of those options) and assign the 'root'#'localhost' account >a new password:
a sequence of steps I shall not quote here
and finished up the rest of the instructions in the docs, and then shutting down the server.
But I realized then the dedicated MySQL pane in the System Preferences of my Mac, which shows whether or not MySQL server is running or not, still showed that MySQL Server Instance was still running. It reminded me of the possibility that I perhaps I did not do enough to have removed the MySQL pane from System Preferences, and what I was seeing was a ghost from my first installation. I wanted to eliminate that, so I went through the whole process, uninstalling and the installing from DMG and initializing MySQL again. But this time, when I try running the server, I get a new error :
Kohs-MacBook-Pro:mysql Kohaugustine$ sudo bin/mysqld_safe --user=mysql &
[2] 15041
Kohs-MacBook-Pro:mysql Kohaugustine$ 160117 11:52:56 mysqld_safe Logging to '/usr/local/mysql-5.7.10-osx10.9-x86_64/data/Kohs-MacBook-Pro.local.err'.
160117 11:52:56 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.7.10-osx10.9-x86_64/data
160117 11:52:58 mysqld_safe mysqld from pid file /usr/local/mysql-5.7.10-osx10.9-x86_64/data/Kohs-MacBook-Pro.local.pid ended
And right now, MySQL server just refuses to startup, no matter how many times I try. Not even when I do it using the GUI through the System Preferences, clicking on Start MySQL Server icon has literally no effect.
I don't know what to do right now, and would greatly appreciate any help on this!
All this just really puzzles me, and I also have the following questions for which any answers on will be of great help:
Why was the data directory already created upon the automated installation from the DMG file? Did the DMG installation also do an initialization already? In that case, then why does the docs still tell us to initialize our installation?
Is the method of uninstalling MySQL that I followed from the instructions I have posted above correct? Does this procedure of uninstallation actually remove MySQL pane from System Preferences?
Its been pretty frustrating trying to install MySQL, but perhaps this has to do with my overall inexperience with databases in general.
Thank you very much.
MySQL could be shutting down because of a permissions issue with your data directory. I just ran into that problem yesterday. Try the following command:
sudo chown -R mysql /usr/local/mysql-5.7.10-osx10.9-x86_64/data
This will change the owner of the data directory to match the user that you're using to run the MySQL daemon. For what it's worth, on my Macbook (Yosemite, MySQL 5.5), the user is "_mysql" instead of "mysql". So you should double-check that.
As for your other questions...
I believe the data directory comes as part of the MySQL package that you download. MySQL keeps information about itself in several MySQL databases. Those databases should be in the data directory when you do a fresh install.
I haven't tried uninstalling MySQL yet, but the steps look like they should work. Specifically, the line about removing files from the PreferencePanes folder should remove the MySQL pane from System Preferences (following a reboot). The bits containing:
sudo rm -rf .../my*
make me a little uneasy though.
Do you have any *nix experience? I think that would help you more than familiarity with databases in this particular case, as you're going under the bright candy shell of OS X and getting into the dark, chocolaty center that is BSD Unix.
Hope this helps. Good luck!