How can I change MariaDB to MySQL in XAMPP? - mysql

A. First things first:
Mr. Google hasn't helped me to found any reply to my question
above
Yes, I have read a solution to the opposite question here
How to upgrade MySQL to MariaDB in XAMPP in 5 minutes on Windows
(and it hasn't helped me: MySQL simply doesn't start)
I don't expect replies like 'MariaDB is better, - stop your silly
exercises'.
B. I am working with MySQL Workbench and because of that don't want to face any incompatibilities either now or in future.
C. Can someone share their experience (if any) in solving this problem?

Running XAMPP with MySQL
Here are exact step by step instructions for truly integrating MySQL into XAMPP on Windows. This has been successfully tested with Windows 10 and XAMPP 7.3.11 for both MySQL 8.0.18 and 5.7.28.
Stop MySQL (which actually is MariaDB) in the XAMPP Control Panel.
Download the MySQL community server as zip archive (Windows 64 bit version)
Rename C:\xampp\mysql to C:\xampp\mariadb
Extract the downloaded zip archive to C:\xampp\mysql. Make sure you extract the folder level which has the subfolders bin, include, lib etc.
Copy C:\xampp\mariadb\bin\my.ini to C:\xampp\mysql\bin
Open C:\xampp\mysql\bin\my.ini in an editor and comment out the line starting with key_buffer= in the [mysqld] section.
Open a command prompt and run the following commands:
For MySQL 8.0.18:
cd C:\xampp\mysql
bin\mysqld --initialize-insecure
start /b bin\mysqld
bin\mysql -u root
CREATE USER pma#localhost;
SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma#localhost;
ALTER USER root#localhost IDENTIFIED WITH mysql_native_password BY '';
ALTER USER pma#localhost IDENTIFIED WITH mysql_native_password BY '';
\q
bin\mysqladmin -u root shutdown
For MySQL 5.7.28:
cd C:\xampp\mysql
bin\mysqld --initialize-insecure --log_syslog=0
start /b bin\mysqld --log_syslog=0
bin\mysql -u root
CREATE USER pma#localhost;
SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma#localhost;
\q
bin\mysqladmin -u root shutdown
Start Apache and MySQL in the XAMPP Control Panel.
Go to http://localhost/phpmyadmin and verify that your database server is now reported as MySQL Community Server.

You can use the following way.
Stop MariaDB in Xampp which show as mysql running...
Download the installer for windows mysql Installer
Follow the instruction.
Now start Apache2 and clear cookie in your browser. Now you can see phpmyadmin and workbench showing Server type: MySQL
If you want to stick to MariaDB then you can use sqlyog also.
Hope it answer your question

You have to do little adjustment with xampp in order to use MySQL instead of MariaDB . I just did following and its worked , i think it may helpful to others also.
Download and install mysql installer.
2.stop xampp and rename the mysql folder inside the xampp directory(may be its not necessary! )
3.just start Apache only from xampp control panel . No need to start mysql.
4.Last step . Make sure your running MySQL in your system . That's it ..
Check php admin panel there you can see Server type: MySQL instead of MariaDB ...
Thanks..

I just upgraded XAMPP because of PHP 7. I am also using mysql workbench. I want to be as close to production as I can, but my webhoster supports only mysql. These where my reasons to switch back from mariadb to mysql
I followed these steps: (also max 5min)
https://gist.github.com/odan/c799417460470c3776ffa8adce57eece

Related

How to solve "MySQL service can not start" error in laragon 5.0.0 when adding a new version of MySQL

Hello guys i need your help to add a new version of MySQL in Laragon (version 5.0.0). Currently I'm using MySQL 5.7.33 and I would like to upgrade to 8.0.28 but unfortunately after trying to add it I got the following error (you can see the details below):
Failed:mysql-8.0.28-winx64
MySQL service can't start
laragon mysql error
Here's how I did it:
I downloaded mysql-8.0.28-winx64.rar file and extracted it to C:\laragon\bin\mysql
And in laragon main window i add it in the following way :
Menu>MYSQL>mysql-5.7.33-winx64>mysql-8.0.28-winx64
After pressing "start all" I get this error: "Service MySQL can not start".
I tried to tweak a bit in the my.ini file but still no solution.
Thank you in advance for your help
would like to share My solution for this I used 64bit version and its in my PC "D" drive with no mysql root password
1.Install c++ redistribution package from Microsoft site "VC_redist.x64.exe"
2-Download mysql8.0.x-winx64.zip archive
3-Extract to "D:\laragon\bin\mysql" directory change drive letter accordingly
4-Stop laragon and and select mysql8.0-winx64 version from Laragon Menu ->version->mysql-8.0.x-win64
5-Now start the Service wait for few seconds to allow initialization
6-Stop mysql server go to directory "D:\laragon\bin\mysql\mysql-8.0.x-winx64\bin" run "mysqld stop" this will stop sql
7-Go to "D:\laragon\data" rename existing "mysql-8" folder to mysql.bk and rename "mysql" folder to mysql-8
8-Stop Laragon and restart it again
open cmd.exe as Administrator
9-go to directory "D:\laragon\bin\mysql\mysql-8.0.x-winx64" run "mysql_upgrade.exe -u root -p" I didnt have password so i left it blank after -p
10-Click Enter without password when prompted Wait for Few minutes to allow mysql do the upgrade
11-now go to mysql terminal from Laragon enter comand "mysql -u root -p" Click Enter without password
12.Now enter the following comand "ALTER USER 'root'#'localhost' IDENTIFIED BY 'NewPassword';" replace NewPassword with your own one
13.Now Restart Laragon again
If you have Phpmyadmin installed it should work now if you dont have install it from add feature
Chears
I found it worked just by following these 4 steps, changing the volume and path to your installed directory
Stop All
Rename folder C:\laragon\data\mysql-8 to C:\laragon\data\mysql-8.bak
Rename C:\laragon\data\mysql to C:\laragon\data\mysql-8
Start All
The directory on your nominated drive laragon\data\mysql is the data directory for MySQL 5.7. When you change to mysql-8, Laragon will upgrade that data directory to MySQL 8 format.
check your folder structure. Now your folder structure is like this
laragon/bin/mysql/mysql-8.0.13-winx64/mysql-8.0.13-winx64
change to laragon/bin/mysql/mysql-8.0.13-winx64
i had the same problem, even though i have this mysql-8.0.13-winx64 install
what did was the change the port number of any other sql service that was running in my machine like in xampp i change the port number from 3306 to 3307 then run my laragon it work
if you try to change port number and is not working Just uninstall XAMPP, restart your system and your Laragon should be working fine again

Cannot connect to MySQL Workbench on mac. Can't connect to MySQL server on '127.0.0.1' (61) Mac Macintosh

Cannot connect to MySQL Workbench on mac. I get the following error: Could not connect, server may not be running. Can't connect to MySQL server on '127.0.0.1' (61)
The help would be appreciated.
Thank You!
Ran into a similar issue and my problem was that MySQL installed itself configured to run on non-default port. I do not know the reason for that, but to find out which port MySQL is running on, run the following in MySql client:
SHOW GLOBAL VARIABLES LIKE 'PORT';
Go to System preferences -> MySql and check the state of your MySql instance.
There may be one or multiple reasons if you are not able to connect to MAC OS X MySQL server with MySQL-workbench.
When you press 'test connection' you might see this error. This could be explained briefly if you go step by step through 'Configure server management..'
On the basis of the red crosses you can filter out the real problem.
The most common problems are associated with the installation of MySQL-server. Few people either forget to install the server prior to installing MySQL-workbench. Some others would install a part of the product. Please check whether you have also installed all the 3 parts that comes with the MySQL-Server dmg(disk image) file which contains mysql-server package. Those 3 parts are: MySQL server, preference pane and startup item.
Note: If you haven't selected preference pane then you won't be able to start mysql server instance from the System preferences.
After you make sure that you have installed each item then you can check server instance of your native mysql-server. Open System preferences from dock and click MySQL. Then click Start MySQL Server to start the server instance. If the server instance is stopped, then MySQL-workbench won't be able to connect to the MySQL server.
If you are still facing issue, then you need to check the port of the connection which you are making. Default port is '3307' and NOT '3306'. You can check it with using the following command in mysql terminal:
SHOW GLOBAL VARIABLES LIKE 'PORT';
Please note that this process helps you to connect to the local instance. If you have to connect to a remote server, then you have to enter that specific IP and Port. Contact your server's administrator if you are facing the issue. As this question specifically states that the problem is related to connecting to the local instance, I am not writing checks that you may need to ensure.
This steps are all in the terminal:)->source
Step make sure your server is running:
sudo /usr/local/mysql/support-files/mysql.server start
Check MySQL version. "This also puts you in to a shell interactive dialogue with mySQL, type q to exit."
/usr/local/mysql/bin/mysql -v
Make your life easier: "After installation, in order to use mysql commands without typing the full path to the commands you need to add the mysql directory to your shell path, (optional step) this is done in your “.bash_profile” file in your home directory, if you don’t have that file just create it using vi or nano:"
cd ; nano .bash_profile
paste in and save:
export PATH="/usr/local/mysql/bin:$PATH"
"The first command brings you to your home directory and opens the .bash_profile file or creates a new one if it doesn’t exist, then add in the line above which adds the mysql binary path to commands that you can run. Exit the file with type “control + x” and when prompted save the change by typing “y”. Last thing to do here is to reload the shell for the above to work straight away."
source ~/.bash_profile
mysql -v
"You will get the version number again, just type “q” to exit."
Check out on which port the server is running:
in your terminal type in: mysql
and then
SHOW GLOBAL VARIABLES LIKE 'PORT';
use everytime a semikolon in the mysql client (shell)!
now you know your port and where you can configure your server(in the terminal with mysql shell/client). but for a successful connection with MySQL Benchmark or an other client you have to know more. username, passwort hostname and port. after the installation the root user has no passwort so set(howtoSetPW) the passwort in terminal with mysql shell/client. and the server is running local. so type in root, yourPW, localhost and 3007. have fun!
Try restarting the mysql or starting it if it wasn't started already. Type this within terminal.
mysql.server restart
To auto start go to the following link below:
How to auto-load MySQL on startup on OS X Yosemite / El Capitan
In my case I had a previous mySQL server installation (with non-standard port), and I re-installed to a different directory & port. Then I got the same issue (in windows). To resolve, you click on home + add new connection.
If you need to know the port of your server, you can find it when you start My SQL command line client and run command status (as below). In windows it is via All Programs -> MySQL -> MySQL ServerX.Y -> MySQL X.Y Command Line Client
I had the same issue, I solved this with the following steps:
Install the MySql (DMG) from this link
If the mysql package comes with the file name "mysql-5.7.13...." and
"MySql.prefPane" then your life is really easy.
Just click on "mysql-5.7.13...." and follow the instructions.
After the installation is done, click on "MySql.prefPane" and checkout "Only
for this user" in the popup. We use "MySql.prefPane" to start the mysql
server as this is really imp because without this you will end up having
errors.
Click on Start MySql Server in the next dialog box.
OR
If you don't see "MySql.prefPane" in the package then follow these steps:
Click on package "mysql-5.7.13...." and this will show you one password as
soon as installation is done. That password is use to start the connection.
You can change it. I will let you know in a while.
After installation save the password (this is really important - you'll need it later), open terminal.
$ cd /usr/local/mysql/bin/
$ ./mysql -u root -h localhost -p
And then type the password from above. This should start mysql>
To change the password:
$ cd /usr/local/mysql/bin/
$ ./mysqladmin -u root -p password 'new_password'
Enter Password: <type new password here>
$ ./mysql -u root -h localhost -p
... and log in with the new password.
After this you can go to MySql workbench and test connection. It should connect.
brew services start mysql defualt set --bind-address=127.0.0.1 with /usr/local/Cellar/mysql/5.6.27/homebrew.mxcl.mysql.plist,so replace --bind-address=127.0.0.1 with --bind-address=* or --bind-address=0.0.0.0
for mac : check the compatible version of mysql server in workbench>preference>MySql
if it's the same version with your mysql server in: cd /usr/local/
I am using those commands on MacOs after getting the same error
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
I had the same problem. I removed mySQL completely, and reinstall it using homebrew.
I had same problem, but it worked for me.
check if you have mysql installed
If you don't have mysql installed, download from this link: https://dev.mysql.com/downloads/mysql/
follow this instructions to install
https://dev.mysql.com/doc/mysql-osx-excerpt/5.7/en/osx-installation-pkg.html
You can test the connection without any problem.
(Sorry for my english, I agree fix me please)
I Hope I've helped.
Greetings.
I ran into the same scenario
I opened "System Preferences", clicked "MySQL", then clicked "Initialize Database" button. I entered a new password and saved it in a safe place.
After that i restarted the MySql Instance (in the System Preferences dialog as well).
After that i opened MySqlWorkbench and opened the default connection, entered the password i set before and: Viola, i can do whatever i want :-)
I had this same issue on Monterey. Make sure you're selecting the correct download according to your processor architecture.
Community download processor architecture
Also, for the Connection Method use the Local Socket/Pipe
connection method
Dropping this to share my experience.
I had the same problem and realise I didn't start MySql server.
The steps below shows how I was able to login:
To start your server, Go to Preference and find MySql.
Click on the instance tab to start the server
Afterward, return back to Mysql Workbench to start the Local Instance and you'll be connected.
Have fun !
I had similar issues in Mac OS Catalina and the easiest way to solve it is by downloading HOMEBREW package manager for mac. Follow the steps to install HOMEBREW and mysql server.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install mysql
$ brew tap homebrew/services
$ brew services start mysql
mysqladmin -u root password 'yourpassword'
Now try using mySQLworkbench it should work.

ERROR 2003 (HY000): Can't connect to MySQL server on localhost (10061)

I installed MySQL on Microsoft Windows 8 Using a noinstall Zip Archive. But when I tested by executing the following commands on windows prompt, the above error showed up.
C:\> "C:\MySQL\bin\mysqlshow"
C:\> "C:\MySQL\bin\mysql" test
You don't need to restart your windows. The easiest way to achieve this is
Go to <Extracted folder location>/bin/
Run mysqld (service)
close the cmd prompt
Run mysql.exe or the better way to do is add the location to PATH environment Variable
Go to Run type services.msc. Check whether MySQL services is running or not. If not, start it manually. Once it started, type mysqlshow to test the service.
Go to bin directory copy the path and set it as a environment variable.
Run the command prompt as admin and cd to bin directory.
Run command : mysqld –install
Now the services are successfully installed
Start the service in service windows of os
Type mysql and go
Though it is an old question, I am adding my answer in it, because the solution that worked for me on Windows 7 as an admin user, is missing in the answers' list. Though my solution is for installed MySQL, I am putting it for those who search for a solution for this error message. Here it is:
Click on the Windows 7 start button and type taskmgr in the search bar
Right click on the taskmgr program icon and select Run as administrator
In the Task Manager window, go to the Services tab
Right click on the MySQL service and click Start Service
The solution that worked for me is:
Downloaded mysql-8.0.22-winx64.zip file
Extracted the zip file
Moved the extracted folder to C:/Program Files
Opened cmd.exe as admin
Navigated to the directory cd C:\Program Files\mysql-8.0.22\mysql-8.0.22-winx64\bin
mysqld -install (Service successfully installed)
mysqld --initialize (no prompt)
Opened services.msc
Found MySQL
Right-click and start
I was stuck on this same issue for what felt like an eternity.
My problem was: I was running mysql from MAMP on port 8889, but when trying to connect to mysql from my command line, it was expecting port 3306. I was running out of ideas, so I tried:
mysql --port 8889
and happiness ensued:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.34-log MySQL Community Server (GPL)
Go to Run type services.msc. Check whether MySQL services is running or not. If not, start it manually.
Run your cmd as administrator.
What you will see is like this:
c:\windows\system32>
Go to your bin location by using cd..
like C:\mysql\bin (my location of bin in my computer is what you are seeing so chose yours correctly)
Run:
$ C:\mysql\bin>mysql --install
Service successfully installed.
Then run:
$ C:\mysql\bin>NET START MySql
The MySql service is starting
The MySql service was started successfully
Then the last step is running:
C:\mysql\bin>mysql -u root - p admin
It will ask for password don't enter anything first time
because it will use blank, and just press enter you are done.
And later you can set password too.
I have a windows 8.1 machine and mysql was not running at all even after trying to start mysqld with no error logs. This solution worked for me:
start cmd in admin mode
type in "net start mysql"
close current cmd window and open new cmd window
type in "mysql"
The mysqld service should now be available.
Had this issue in Windows 10 and MySQL 8. Resolved by following steps:
Searchbar(bottom left) > Task Manager > Run as administrator > Services > MySQL80
Well that could have some reasons.
THe first one is that the MySQL server/service not started.
If he is started you should check out the logfiles, and make sure there are no problems.
You could also uninstall the MySQL service and install XAMPP.
With XAMPP it is easier to manage this services.
Despite that my server was running, I had the same problem.
I found out that it was the port. So you need to specify the port:
mysql -u user -p --port 0000
The port on your machine may be different. To find out on which port mysql is running open the mysql ini file and look for port=. A port often used is 3306.
Example how to log on to mysql
mysql -u root -p --port 3306
Test if the server is running. You can use netstat for this. See https://serverfault.com/questions/260239/unable-to-connect-to-mysql-through-port-3306
If it is running, it may be the firewall. You can turn that off to test if that is the problem.
See the following manual to install Mysql as a service: https://dev.mysql.com/doc/refman/5.5/en/windows-start-service.html
First of all, you need to ensure the port number on which the server is running. Then you can run
mysql -u username -p --port portNumber
on the command line
Executing the mysqld command can solve your problem.
My SQL version is 5.7.
If you're using the no install zip, you need to execute mysqld.exe first to start the service, and then execute mysql.exe to open your connection.
The no install is nice, but if you intend to do any serious work with MySQL, you may want to consider either using the MSI to do a proper installation, or if you're doing web development work give XAMPP a try.
Check Mysqld.exe file is in your bin folder. if it is not there , just copy that file from any other computer and paste it on your bin folder.Just double click. Then run mysql.its solved
This error is flashed when we are trying to open mysql with out stating the service.
Open cmd prompt
to start the service type
mysqld --console
This will start the mysql service
Don't close this cmd prompt and open a new cmd prompt and
type
mysql -u root -p
Then enter ur password
Make sure your mysql is running in default port (3306) , if you are running mysql with different port (for example: 3307), you must specified the port number while connecting to the server.
If your port is different than default port, then try with this command.
mysql -u <username> -p --port<port number>
For eg:
mysql -u root -p --port 3307
Go and search Services in Windows
Now search Mysql. Right Click on it. By Default it's startup type will be 'Automatic'. Click on Properties on right clicked menu.
You will find startup type Switch it to -> Manual So that We can start and stop by our choice.
Now Get Back and Right Click to Mysql on Services and Click Start.
Now Mysql has started successfully
To get started
Start Mysql Shell
& type command
shell.connect({host: 'localhost',user: 'root'})
Now type password
To type sql commands:-
/sql
I had the same problem. I tried all of the answers above (and some from other websites). In the end, my issue was that my cache wasn't configured. I found that info in my error log and fixed it by changing the line in the file:
C:\MAMP\bin\apache\conf\extra\http-ssl.conf
There I removed the double quotes from the line:
SSLSessionCache "shmcb:/some/example/path/ssl_scache(512000)"
to:
SSLSessionCache shmcb:/some/example/path/ssl_scache(512000)
and saved with Ctrl+S and closed the file.
Here's the link that helped me:
https://wiki.apache.org/httpd/SSLSessionCache
I faced the same problem couple of times and each time the reason was different:
The solution that worked first time was that by "Abhishek Oza" which is same as that of "amey91" (see above)
The second time, my server was on a different port number than the default one(3036),so i was not able to connect.So I had to specify
the port number explicitly for making the connection which you can do
simply by writing: "mysql --host=127.0.0.1 --port=8081(specify your
port number here) mysql -u root -p"
In my case, which was a manual install using the .zip file.
I solved this by specifying the nonstandard MySQL and Data install locations in a my.ini.
https://dev.mysql.com/doc/refman/8.0/en/windows-create-option-file.html
Then I needed to run the data directory initialisation commands:
https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization-mysqld.html
Then running:
net start mysql
There is a possibility that your installation of MYSQL got corrupted. The best thing you can do is to search for MYSQL INSTALLER on your system and then run it again.
It will not download the mysql server again, it will just help you to set it up.
After that, edit your environment variables path and add the bin folder of your mysql to it.
By now, it should work.
In my case I have 2 different version of mysql in Windows OS and I solved the my problem by bottom step:
first stop all mysql service.
I create one config file in C:\mysqldata.cnf with bottom data(my mysql is in "C:/mysql-5.0.96-winx64" directory ):
[mysqld]
datadir = C:/mysql-5.0.96-winx64/data
port = 3307
then I run bottom command in cmd:
C:\mysql-5.0.96-winx64\bin\mysqld --defaults-file=C:\mysqldata.cnf --console
above step reference
then I create txt file in C:\resetpass.txt with bottom data:
UPDATE mysql.user SET password=PASSWORD('ttt') WHERE user='root';
then run mysqld with bottom command:
C:\mysql-5.0.96-winx64\bin\mysqld --init-file=C:\resetpass.txt --install mysql2 --console
net start mysql2
after these step you have one mysql service(with name mysql2) than run with port 3307.
I have 2 version of mysql with different user management tables(in version 5.0.96 user table difference with 5.5 version because of that I must be change table folder in first step)
you can run other mysql service with other port now(and you can run this steps with different datadir, service name and port for it again)
First make sure you have installed MYsql+Sqlyog(if you are using it.).
Start Registry Editor (Regedt32.exe).
Locate the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, click Add Value, and then add the following registry value:
Value Name: MaxUserPort
Data Type: REG_DWORD
Value: 65534
This sets the number of ephemeral ports available to any user. The valid range is
between 5000 and 65534 (decimal). The default value is 0x1388 (5000 decimal).
On the Edit menu, click Add Value, and then add the following registry value:
Value Name: TcpTimedWaitDelay
Data Type: REG_DWORD
Value: 30
This sets the number of seconds to hold a TCP port connection in TIME_WAIT state before
closing. The valid range is between 30 and 300 decimal, although you may wish to check
with Microsoft for the latest permitted values. The default value is 0x78 (120 decimal).
Quit Registry Editor.
Reboot the machine.
I will advise to use first check if my.ini exist in mysql folder in c drive or in windows folder
mysqld -install (Service successfully installed)
mysqld --initialize (no prompt)
Also another advise is not to use mysql 8, since it is not compatible with wordpress or any other opensource yet, there are lot of changes between version 5 and version 8, so if you are using mysql please use version 5.x.
Steps to resolve the problem ->
Go to command prompt and at root of c (c:\ if environment variable-path is set)
type -> c:\>mysqld -install.
Then type -> c:\mysqld --initialize
Now create one .txt file (here in our example we are taking init.txt) at root of mysql(may vary according to your directory) ->c:\MySQL\init.txt.
Now open that .txt file(init.txt) and write in it ->
5.open Run console and write -> Services.msc
6.Then Services window will be open ,there select MYSQL,Double click It and press start
7.Finally open new Command prompt window and type at root of c (c:) ->c:\>mysqlsh
due to this shell will execute and here you are ready to go....
mysql -u root --port 3308
this one help me
port number from phpmyadmin default port is 3306

Dump File MySQL 5.6.10

I was trying to create a dump file from my MySQL database, but when I try it always gives me this error
Operation failed with exitcode 2
16:06:07 Dumping proactivetraindb (userstate)
Running: mysqldump.exe --defaults-extra-file="h:\docume~1\anarita\locals~1\temp\tmpde5rwy.cnf" --user=root --max_allowed_packet=1G --host=localhost --port=3306 --default-character-set=utf8 "proactivetraindb" "userstate"
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)
The version of MySQl is 5.6.10 but the version of MySQLDump is 5.5.16
Does someone know how to solve this?
As outlined by a previous answer, but just to clarify further: This is for MySQL in Windows.
I was having the exact same issue while trying to dump data out of a table on a local test server, and based on the previous answer, this is how I did it.
Find your mysql original download folder, and look in the /bin folder, there should be a mysqldump.exe.
Go into Workbench Preferences: Edit -> Preferences -> Administrator -> Path to mysqldump Tool, and enter in the path to the mysqldump.exe that you found.
Save by pressing "OK" and restarting Workbench.
Open up terminal, but typing in cmd in the Search area of the start menu (Windows 7), and find the sql folder you found in step 1, and cd into bin. It should look like C:\...\bin>. Here, type in mysqldump -t -u [username] -p [database name] [tablename]. This should dump the data from the [tablename] table into the dump folder as designated in Workbench.
Hope this helps!
I had the same error in MySQL Workbench.
Find out where is the mysqldump tools provided by your install of MySQL 5.6. On my mac it was at "usr/local/mysql-5.6.10-osx10.7-x86_64/bin/mysqldump".
Then I set up this path in MySQL Workbench/Preferences/Administrator/Path to mysqldump Tool
Give MySQL Workbench a restart.
It should work.
The reason for this is that MySQL 5.6 has removed support for "SET OPTION" and your mysql client tools are probably on older version. Most likely 5.5 or 5.1. There is more info about this issue on MySQL bugs website.
The quickest solution is to update your mysql client tools to 5.6 and your problem will be solved. If you are on Linux platform, here is a solution that worked great for me:
http://www.markomedia.com.au/mysqldump-mysql-5-6-problem-solved/
You must use mysqldump 5.6.x to be able to dump mysql 5.6 database, because MySQL 5.6 discontinued and removed support for SET OPTION syntax.
Under 32/64bit Windows you must do:
1.1. (32bit win) Download Windows (x86, 32-bit), ZIP Archive 5.6.19 212.3M http://dev.mysql.com/downloads/mysql/ (direct link http://dev.mysql.com/downloads/file.php?id=452188)
1.2. (64bit win) Download Windows (x86, 64-bit), ZIP Archive 5.6.19 217.2M http://dev.mysql.com/downloads/mysql/ (direct link http://dev.mysql.com/downloads/file.php?id=452189)
2. Extract mysqldump.exe from just downloaded file mysql-5.6.19-win32(64).zip (from /mysql-5.6.19-win32(64)/bin/mysqldump.exe)
3. Replace this just extracted file with your already installed mysqldump.exe file (instalation dir/mysql/bin/mysqldump.exe)
Using Windows 7, a far easier solution for me was to find mysqldump.exe from; C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe
copy it and then replace the MySQL workbench mysqldump.exe which is located in the root of workbench C:\Program Files\MySQL\MySQL Workbench CE 5.2.47\mysqldump.exe
Restart MySQL workbench and all should work fine.
You are probably using Amazon RDS, right?
You can just get the newer version of mysqldump, v5.6 and use it instead.
Download the portable zip here and extract just the mysql\mysqldump.exe there.
http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.8.3/
I tried it just now and it worked fine for me.
If you are using Window 10. Your Mysql server would have been installed in C:\Program Files\MySQL directory and rest all components are installed in C:\Program Files (x86)\MySQL.
Go to MySql Workbench>Edit>Preferences. A window will open, click the Administrator tab and mention the path of your mysqldump.exe (which is present in C:\Program Files\MySQL). Restart your workbench.
Thanks, Happy coding!!
In Workbench look for Preferences: Edit -> Preferences -> Administrator -> Path to the mysqldump Tool. Browse your MySQL folder inside the bin folder and look for mysqldump.exe.
I had this problem on the Amazon EC2 acessing a RDS Mysql 5.6 database. I just ran
sudo apt-get upgrade
It didn't update mysql client to 5.6, but mysqldump now is working fine.
For Mac it depends on your installation.
If you used a dmg file to install it, you need to find the bin directory.
mine was under /usr/local/mysql/bin
You will find mysqldump file under this folder.
Now provide this location in your
Preferences -> Administrator -> Path to mysqldump Tool as /usr/local/mysql/bin/mysqldump
You should be good to export now.
If you are on Linux, update mysql-client to latest version. On Ubuntu:
sudo apt-get upgrade mysql-client
did the job for me.
Setting up mysql-client-5.5 (5.5.43-0ubuntu0.12.04.1) ...
Mine got updated to 5.5 and mysqldump now works for me. This is on Amazon RDS with MySQL 5.6.x
If you're on a linux machine, this is provided by the mysql-client package. Installing that fixed the problem for me.
For compatibility, I needed MySQL 5.6.41 on my Windows 10 machine, so I used the 5.6.41 MySQL installer to install "All" (My Workbench, MySQL, connectors, etc).
Even though I used the installer for version 5.6.41, it installed Workbench 8.0, as well as version 8.0 of the various connectors, etc.
So of course, I got a similar error.
There seems to be no easy way to force lower version of MySQL Workbench to be installed instead (On my previous machine, before workbench 8.0, did NOT have this conflict when installed).
Solution that worked for me:
Find the version of mysqldump.exe that matches the version of MySQL you're using:
From Windows Explorer, I searched my machine for all versions of mysqldump.exe
Right-clicked each mysqldump.exe it found -> Properties -> Details tab.
Found the version 5.6.41 (matching the MySQL version I'm running)
Clicked back to the General tab, to see the folder path that that version of mysqldump.exe was installed in
C:\Program Files\MySQL\MySQL Server 5.6\bin, in my case
(version 8.0 was installed in C:\Program Files\MySQL\MySQL Workbench 8.0 CE)
Now open MySQL Workbench..
Edit -> Preferences -> Administration -> Path to mysqldump Tool
Paste in the file path for the appropriate version of mysqldump.exe (including the file name!)
Click OK
Restart MySQL Workbench
This worked for me. However, I have no idea how to make this work if you have two versions of MySQL on your machine, say MySQL 5.6 and 5.7, or 8.0.
So when I upgrade (any/some/all of) my cloud servers to version 5.7, this looks to be another challenge to overcome. Since Workbench only allows a single mysqldump.exe file, to be used no matter which version of my local MySQL server is running... Or perhaps manually change the path location, each time open a connection that uses the Port to the other MySQL version (and remember to change it back after?).
For this reason, I Removed MySQL 5.7 completely, and will hence keep all cloud (and my local) servers at 5.6 for the time being - a Project for another day.
For Ubuntu users to save your time, mysqldump is in "mysql-community-client_5.7.26-1ubuntu16.04_i386.deb " package
I just had the same problem and I put a couple of different answers together.
The pro for me was, that I could switch easily between 5.6, 8, ... without having to up/downgrade ubuntu dependencies each time.
The easiest way for me on Ubuntu was to just download the 5.6 (or 5.7, whatever you want) mysqldump binary and change that in workbench.
Everything went well after that:
go to https://downloads.mysql.com/archives/community/ and download the correct version you want (for me: 5.6.47 for 64x)
Unpack the archive somewhere, you can find later
Change the mysqldump binary in mysql workbench: Edit -> Preferences -> Administrator -> "Path to mysqldump Tool" to {{YOUR_UNPACKED_FOLDER}}/bin/mysqldump
Save it with Ok
Now you should be able to just export and it will use mysqldump 5.x.
I have Mysql 5.6.12 version. SET SQL_QUOTE_SHOW_CREATE=1 is working fine in my machine.
now i am able to take a dump of sql.
mysql> SET SQL_QUOTE_SHOW_CREATE=1; Query OK, 0 rows affected (0.00
sec)
worked for me.

How to start MySQL server on windows xp

Whenever I try to start MySQL by typing
> mysql -u root
I get the error
ERROR 2003(HY000): Can't connect to MySQL server on 'localhost' (10061)
How can I solve the problem above? I just downloaded MySQL and unzipped it in the E: drive. I have not done anything else. Do I have to make a connection first? If so, how can I do that?
Here is the ZIP file that I had downloaded: mysql-5.7.15-winx64.zip
Here are the steps to start MYSQL Server (mysql-5.7.15-winx64) for the first time on Windows:
Create a new folder named "data" in MYSQL installation directory (i.e. in the same location as where "bin" directory is located. For me it is: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64. This location will vary as per the location where you have extracted the MYSQL zip file)
From here I will use my MYSQL folder location as reference. Go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin and execute the command: mysqld --initialize-insecure or mysqld --initialize depending on whether you want the server to generate a random initial password for the 'root'#'localhost' account.
To start the DB, go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin and execute mysqld --console You can see the start-up logs being printed.
To connect to DB, go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin and execute mysql -u root -p. When prompted, Enter password if it has been set or else just hit "Enter" button to connect
The MySQL server can be started manually from the command line. This can be done on any version of Windows.
To start the mysqld server from the command line, you should start a console window (or “DOS window”) and enter this command:
shell> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld"
The path to mysqld may vary depending on the install location of MySQL on your system.
You can stop the MySQL server by executing this command:
shell> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root shutdown
**Note : **
If the MySQL root user account has a password, you need to invoke mysqladmin with the -p option and supply the password when prompted.
This command invokes the MySQL administrative utility mysqladmin to connect to the server and tell it to shut down. The command connects as the MySQL root user, which is the default administrative account in the MySQL grant system. Note that users in the MySQL grant system are wholly independent from any login users under Windows.
If mysqld doesn't start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem. The error log is located in the C:\Program Files\MySQL\MySQL Server 5.0\data directory. It is the file with a suffix of .err. You can also try to start the server as mysqld --console; in this case, you may get some useful information on the screen that may help solve the problem.
The last option is to start mysqld with the --standalone and --debug options. In this case, mysqld writes a log file C:\mysqld.trace that should contain the reason why mysqld doesn't start. See MySQL Internals: Porting to Other Systems.
Via MySQL Official Page
If the command prompt does not work in Windows, try the following:
1) Open services in Windows.
2) Then check the status for Mysql and if you found status nothing or blank then start the mysql service.
3) After then see whether the mysql is start or not .If it shows started then try to check mysql working.
It has worked for me when cmd commands were not working.
Run the command prompt as admin and cd to bin directory of MySQL
Generally it is (C:\Program Files\MySQL\mysql-5.6.36-winx64\bin)
Run command : mysqld --install. (This command will install MySQL services and if services already installed it will prompt.)
Run below commands to start and stop server
To start : net start mysql
To stop : net stop mysql
Run mysql command.
Enjoy !!
maybe
E:\mysql-5.1.39-win32\bin>mysql -u root -p
Type
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --console
to start the sql server and then test the client connection.
I was using MySQL Server 5.5 as a result I was missing the folder which majority of the answers made mention of in the bin folder. What I did instead was the following:
Open Explorer and make your way to C:\Program Files\MySQL\MySQL Server 5.5\bin or your MySQL installation directory.
Run the executable application MySQLInstanceConfig and follow the images below.
This solved my issue and I was able to access the database without any errors.
Start mysql server by command prompt
C:> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --console
Or alternative reach up to bin then
mysqld --console
It will start your server.
If you have mysql command line client available
click on it
it show enter your password :
Please enter your password.
Then you can access it.
You also need to configure and start the MySQL server. This will probably help
I tried following steps to run mysql server 5.6 on my windows 8.
Run command prompt as an administrator
go mysql server 5.6 installation directory (in my case: C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin) copy that location
In Command prompt run "cd C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin"
run "mysql -u root"
You need to run the server first. The command you use (in the question) starts a client to connect to the server but the server is not there so there the error.
Since I am not a Windows user (Linux comes equipped) so I might not be the best person to tell you how but I can point to you to a guide and another guide that show you how to get MySQL server up and running in Windows.
After you get that running, you can use the command (in the question) to connect it.
NOTE: You may also try http://www.apachefriends.org/en/xampp.html if you plan to use MySQL for web database development.
Hope this helps.
The error complains about localhost rather than permissions and the current practice in MySQL is to have a bind-address specifying localhost only in a configuration file.
So I don't think it's a password problem - except that you say you 'unzipped' MySQL.
Is that enough installation? What did you download?
Was there any installation step which allowed you to define a root password?
And, as NawaMan said, is the server running?
first thing you need to do is to start the mysql
for that you can use
E:\mysql-5.1.39-win32\bin>net start mysql (only when there a mysql running as service)
then you can execute
E:\mysql-5.1.39-win32\bin>mysql -u root
Run your command prompt as administrator.#
We can start MySQL service from windows command line using the below command.
net start mysql
Command to stop MySql service:
net stop mysql
Disable MySql service:
sc config mysql start= disabled
Command to enable MySql service(to automatically start MySQL service when the system starts up):
sc config mysql start= auto
Command to set the startup type to manual:
sc config mysql start= manual
How to restart MySql service?
There is no direct command to restart a service. You can combine stop and start commands like below.
net stop mysql & net start mysql
I was also having problem with starting MySql server but run command as mention right mark in picture . Its working fine .
mysql -u root -p
After entering this command in terminal, it will ask for password
Enter the password and you are ready to go!
there is one of the best solution do resolve this problem and it is going to work 100%.
as we know that server is a process so treat it like a process go to the task manager
in windows and see for services in task manager in that service see for Mysql and MS80 and try to start it manually by click on it and say run then will take some time.
go to your mysql workbench and click on start/shutdown then try to refresh the server status in server status option. it will load up thats it.
1.Open a command prompt as Administrator.
2.Go to MySQL installed bin directory in program files.
3.Copy the location of the bin directory from windows explorer.
4.In command prompt type cd and (paste the location) and do enter.
5.Type mysqld --initialize
6.Open services from the windows menu and sort the list by name.
7.Right-click Mysql and click start.
use the command "mysql -u root -p" in the bin folder path.
and give the MY SQL password which you have set earlier.