Installing MySql in D: drive instead of C: - mysql

I would like to install MySql in the D: drive instead of my C: drive and subsequently have all my databases stored in a folder that should look like this D:\ProgramData\MySQL\MySQL Server %VERSION%
I wasn't able to find satisfactory answers:
https://forums.mysql.com/read.php?169,644290,644290
https://forums.mysql.com/read.php?11,39720
Mysql installation to different drive
And on the MySql documentation section the only mini-guide is this:
https://dev.mysql.com/doc/mysql-installer/en/mysql-installer-change-path-proc.html
So my question is:
is it feasible to install MySql in D: without incurring in major or even minor problems down the road? Has anybody tried this and have have some tip on how to conduct the installation to avoid possible pains in the future?

In the latest version of MySQL Installer, the "Advanced Options" link as described here is no longer there. However, you can trick the installer into giving you extra options where you can change the Install Directory and the Data Directory.
If you are installing MySQL Server 8.0.22, for example, the installer will try to create the folder C:\Program Files\MySQL\MySQL Server 8.0. But if you create this folder before opening the installer, then when you go to step 2 in the installer, you will be presented with "Path Conflicts" options where you can specify different directories.
Click here to see a screenshot of the secret Step 2
Note: This same approach works for MySQL Workbench. The folder you would create is C:\Program Files\MySQL\MySQL Workbench 8.0 CE.

In the 8.0.26 (installer version 1.4), you can choose the Custom Setup type.
And in the next step you go to Advanced Options and specify the location to install.

Related

MySQL Workbench Unable to Retrieve Disk Space in Data Dir, Server Stopped

I had mySQL workbench working fine a few weeks ago. Now, any time I log in, I get no connection. Upon inspecting Sever Status, it is showing Stopped. Also, under the Server Directories, it says Unable to Retrieve next to Disk Space in Data Dir.
I also noticed that the configuration file was wrong, or outdated? The Configuration File originally read:
C:\ProgramData\MySQL\MySQL Server 5.5\my.ini
But I looked and there was no MySQL Server 5.5 file in my directory. I do have a MySQL Server 8.0 folder, so I changed the Configuration File to:
C:\ProgramData\MySQL\MySQL Server 8.0\my.ini
However, this fails to solve the problem. I've also attempted to run Services from the Start Menu, right click on MYSQL80, and choose start - and it says the service has Started then stopped.
I'm not even sure this missing or mis-directed file is the issue, or whether it's the Unable to Retrieve Disk error (or both are causing the server to fail). I recently changed my login password for my computer - but I doubt that is related to the login credentials for MySQL, right? (I see MYSQL80 properties has password for 'log on' option, but I have no idea what this password even is, or how to change it).
I've also read about this problem online and cannot seem to find an answer that solves the issue. I've tried running MySQL Workbench as an admin too, and that doesn't work either.
Can anyone point me in the right direction? Is there a way to get the server up and running again without a bunch of complicated command line? I appear to have mysqld.exe in the bin file in MySQL 8.0
Thanks all in advance!
In MySql Workbench Server -> Startup/ShutDown -> Start Server.
This Worked for me.
When the my.ini file is messed up I think the best solution is a total uninstall/delete and manual install. Before you do any of the following make sure you go to your current data dir and save your database folders. Then dlete all of your current MySQL related directories and uninstall MySQL and MySQL workbench.
I had this problem when I installed MySQL 8.0.15 with the community installer. The my.ini file that came with the installer did not work correctly after it had been edited. I did a full manual install by downloading that zip folder. I was able to create my own my.ini file containing only the parameters that I was concerned about and it worked.
download zip file from MySQL website
unpack the folder into C:\program files\MySQL\MySQL8.0
within the MySQL8.0 folder that you unpacked the zip folder into, create a text file and save it as my.ini
include the parameters in that my.ini file that you are concerned about. so something like this(just ensure that there is already a folder created for the datadir or else initialization won't work):
[mysqld]
basedire=C:\program files\MySQL\MySQL8.0
datadir=D:\MySQL\Data
....continue with whatever parameters you want to include
initialize the data directory by running these two commands in the command prompt:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --default-file=C:\program files\MySQL\MySQL8.0\my.ini --initialize
install the MySQL server as a service by running these two commands:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --install --default-file=C:\program files\MySQL\MySQL8.0\my.ini
finally, start the server for the first time by running these two commands:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --console

how to get most recent mySQLdump tool

Perhaps not really a suitable SO question but I'll give it a try.
When I try to dump my DB from the remote server, my MySQL workbench for MacOS tells me:
Applications/MySQLWorkbench.app/Contents/MacOS/mysqldump is version 5.7.12, but the MySQL Server to be dumped has version 5.7.15.
Because the version of mysqldump is older than the server, some features may not be backed up properly.
It is recommended you upgrade your local MySQL client programs, including mysqldump, to a version equal to or newer than that of the target server.
The path to the dump tool must then be set in Preferences -> Administrator -> Path to mysqldump Tool:
I have version 6.3 installed, and the built-in "check for updates" only tells me I already have the latest version.
Does anyone know where I can go to download this more recent dump tool? I looked around on the MySQL.com but couldn't find it.
There's a simple way to solve your problem.
Just go on google type: mysqldump 5.7.20 (this number is the version are you looking for, in my case is 5.7.20)
choose the link site from https://dev.mysql.com/downloads/mysql/
on that page scroll down until you see a list of avaible downloads, choose your operating system (in my case is Windows) then... download the zip that has the version you are looking for.
unzip that folder... go to bin inside it... from there copy mysqldump and paste it into your MySQLWorkbench folder... (replacing the one is in there)
restart your MySQLWorkbench... and that is all.
You just need to update the mysqldump.exe.The up to date version of the exe can be found in. To solve the issue just go to Edit->Preferences->Administrator ,and browse the following path
for example C:\Program Files\MySQL\MySQL Workbench CE 5.2.47\mysqldump.exe
If for some reason you have two separate installations of the SQL server, you might be pointing to the wrong sqldump.

Issue with MySQL Server

My problem is that windows services don't have MySQL Server. How to run it?
I need to run MySQL Server on a new for me laptop. There's Windows 7. And MySQL have been installed on it. In order to verify this, I opened the Programs and Features window and saw it there:
But when I go to the Services to run it, I don't find it. It's absent there:
It's very strange for me. Why MySQL is not among the services? How can I run it? It's installed on this station.
Try performing the following steps and then check again.
Start Command Prompt (cmd)
Go to the "C:\Program Files\MySQL\MySQL Server 5.6\bin"
type mysqld --install
In my case I installed it through XAMPP so I do not have it among windows services (it has it´s own control panel), but I found this document that may help you solve this problem:
https://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html
Also check the error log file which shows specific information about the start and stop of the service. In my case is called mysql_error.log and it is located under the '...mysql\data\' folder. Another document talking about that:
https://dev.mysql.com/doc/refman/5.7/en/error-log.html

MySql configuration file does not exist where WorkBench says so

I'm new to MySql. I have downloaded and installed MySql 5.6 together with the latest version of Workbench (6.2). Workbench says my configuration file is in
C:\Program Files\MySQL\MySQL Server 5.0\my.ini
This folder does not exist. I have
C:\Program Files\MySQL\MySQL Server 5.6
And inside this folder there is an .ini file called my-default.ini. How can I find the correct .ini file so I can change my variables?
The name and path used by MySQL Workbench by default is taken from a template. There are several templates for various server versions and platforms with typical config file locations. However, they may not always work. On Windows however, with standard installations (which are extremely common), there are only very few variations. The simplest way to have the correct config file stored in the connection settings is by changing the installation type in the System Profile settings for a connection:
The sample config file my-default.ini is just that, an example. The installer should have created a concrete config file in the ProgramData MySQL folder for your server, which is what MySQL Workbench will also use by default.
For someone wants to find the menu answered above,
It can be found when you right click on a connection instance box of your MySQL workbench home and go to edit connection.
I know this question posted 5 years ago, but I had looked for the menu as well and finally find it. I hope I can add a comment but I cannot due to the reputation;)

MySQL my.ini location

I have already seen
http://dev.mysql.com/doc/refman/4.1/en/mysql-config-wizard-file-location.html
how to know mysql my.cnf location
and
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
But I am still stuck with the ages old question!
"Where is my my.ini"
I am using windows server 2008 with mysql 5.5.28. I installed the service using mysqld --install and I am able to use the mysql server using sqlyog. But unfortunately I am not able to find my.ini in installation directory or not in c:\ neither in c:\windows nor in data_dir query show variables like "mysql_home" returned nothing as well.
Any suggestions?
my.ini LOCATION ON WINDOWS MYSQL 5.6 MSI (USING THE INSTALL WIZARD)
Open a Windows command shell and type: echo %PROGRAMDATA%. On Windows Vista this results in: C:\ProgramData.
According to http://dev.mysql.com/doc/refman/5.6/en/option-files.html, the first location MySQL will look under is in %PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini. In your Windows shell if you do ls "%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini", you will see that the file is there.
Unlike most suggestions you will find in Stackoverflow and around the web, putting the file in C:\Program Files\MySQL\MySQL Server 5.6\my.ini WILL NOT WORK. Neither will C:\Program Files (x86)\MySQL\MySQL Server 5.1. The reason being quoted on the MySQL link posted above:
On Windows, MySQL programs read startup options from the following
files, in the specified order (top items are used first).
The 5.6 MSI installer does create a my.ini in the highest priority location, meaning no other file will ever be found/used, except for the one created by the installer.
The solution accepted above will not work for 5.6 MSI-based installs.
Enter "services.msc" on the Start menu search box.
Find MySQL service under Name column, for example, MySQL56.
Right click on MySQL service, and select Properties menu.
Look for "Path To Executable" under General tab, and there is your .ini file, for instance, "C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MYSQL56
I've found mine in
\ProgramData\MySQL\MySQL Server 8.0\
(It is a hidden folder)
You can type win+R and write %PROGRAMDATA% to access that folder, or just enable show hidden folder.
You have to look I the folder C:\Program Files\MySQL\MySQL Server 5.5 but there is a problem. When you perform an MSI install of MySQL, my.ini is not created. There will be sample .ini files in that folder. In order to use one of them, say my-medium.ini, you need to do the following before a MySQL restart:
cd C:\Program Files\MySQL\MySQL Server 5.5
copy my-medium.ini my.ini
net stop mysql
net start mysql
Once, you do this, my.ini can be read by C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe.
Start MySQL Workbench, then Server -> Options File and look at bottom of the window; it will say something like "Configuration File: C:\ProgramData\MySQL\MySQL Server 5.6\my.ini"
(And note the subtle difference between "ProgramData" and "Program Files" - easy to gloss over if you're looking for a quick answer.)
Answered for only MySQL Workbench users,
You can find the my.ini file in windows at this location-
C:\ProgramData\MySQL\MySQL Server 5.6
the ProgramData folder is a hidden folder, so make the according setting to see that folder.
And open my.ini file as an administrator to edit and then save that.
In my case, the folder ProgramData was hidden by default on windows 7, so I was unable to find my.ini file.
After selecting show hidden files and folders option, I was able to find the my.ini file at the location: C:\ProgramData\MySQL\MySQL Server 5.6.
Display hidden files and folders on windows 7:
Right-click the Windows Logo button and choose Open Windows Explorer.
Click Organize and choose Folder and Search Options.
Click the View tab, select Show hidden files and folders and then clear the checkbox for Hide protected system operating files.
Click Yes on the warning and then click OK.
Press the windows key > type services > press enter > Look up mysql in the list > right click > properties > Path to Executable will have the location of the defaults file right below it (my.ini)
it is there at C:\Program Files\MySQL\MySQL Server 5.5 there are various .ini files with small, medium & large names. generally medium is used or it depends on your requirement.
programData is hidden folder so you have to change the option from setting to show hidden folder and then make the change in my.ini file present in that.
Be sure to update the correct my.ini file because it can waste a lot of your time if you keep updating wrong file.
You can look into service to see which my.ini is configured in this service.
Open your run console
type: services.msc
look for: mysql
right click
properties
where is written "path to executable", click and move the cursor to the right until you see the directory of my.ini, it's written "defaults-file-".
to reach it manually on your explore folders you have to enable the visualization of hidden elements (explore folder>top menu>visualize>visualize hidden elements)
as explained by this video
https://www.youtube.com/watch?v=SvCAa2XuQhg
on Windows if MySQL is install as a service you can change the binpath of the service. For example
sc config MySQL57 binPath= "\"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe\" --defaults-file=\"<myini path>" MySQL57"
space after binpath is important. You must escape double quotes
MySQL and MariaDB
According to the documentation of both MySQL and MariaDB you need to run mysql with --help --verbose to know the location of the my.ini file
Go to the command or terminal
cd yourMySQLBinDirectory
mysqld --verbose --help
You will see large output but first few lines will show the order the server is looking for the file. I got the following response. It will be different for your computer or server.
Default options are read from the following files in the given order:
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf D:\Databases\mariadb-10.3.30-winx64\my.ini D:\Databases\mariadb-10.3.30-winx64\my.cnf D:\Databases\mariadb-10.3.30-winx64\data\my.ini D:\Databases\mariadb-10.3.30-winx64\data\my.cnf
I met with the same problem when I did MSI install of MySQL and there were no my-medium.ini files too when I tried the above steps. Only installing the ZIP file of MySQL helped me. So, I suggest you to uninstall the MSI installed folder and reinstall using the ZIP file.
For MySql Server 8.0 The default location is %WINDIR% or C:\Windows.
You need to add a "my.ini" file there.
Here's a sample of what I put in the ini file.
[mysqld]
secure_file_priv=""
Make sure to restart the MySQL service after that.