MySQl Configuration Error After reinstall it - mysql

When I reinstall MySQL database after uninstall it, I got this error when configuration:
Error 1045
Now, My new directory is here:
E:\Program Files (x86)\MySQL\MySQL Server 5.5
and my old directory was this:
c:\Program Files (x86)\MySQL\MySQL Server 5.5
I delete whole MySQl folder on drive c , But it has error when want to config!
How can i fix this problem?
Thanks is advance.

You can follow this method as well:
Menu>Start>Run>CMD
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld.exe" --skip-grant-tables
Let's this window open and open a new one
Menu>Start>Run>CMD
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe" -u root
You're now connect to MySQL, you have to modified the root account in the date of MySQL
mysql> use mysql;
mysql> UPDATE user SET password=PASSWORD('motdepasse') WHERE user="root";
mysql> flush privileges;
mysql> exit;
Restart with MySQL Command Line Client
That's it

You should delete the data directory and then retry to install it, it should be in:
C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\data
As mentioned on the last paragraph of your screenshot:
If you are re-installing after you just uninstalled the MySQL server please note that the data directory was not removed automatically. Therefore the old password from your last installation is still needed to connect to the server. In this case please select skip now and re-run the Configuration Window from the start menu.

Your solution:
1. "Add or Remove Programs
2. Deleted c:\mysql
3. Rebooted the PC
4. Reinstalled MySQL

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

How can I change MariaDB to MySQL in XAMPP?

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

After install, mySQL doesn' start (windows10, source install)

I'm installing Apache server, php, and MySQL on Windows10.
First two was successful but MySQL has a problem.
I installed MySQL into C:\mysql-5.7.10-winx64, and changed my.ini like this
basedir = C:/mysql-5.7.10-winx64
datadir = C:/mysql-5.7.10-winx64/data
port = 3306
I succeeded install but if I try to start, it shows like below
C:\Windows\system32>net start mysql
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
However, if I check Computer Management>Event Viewer>Custom Views>Summary page events, it tells me "failed to set datadir to C:\mysql-5.7.10-winx64\data\"
If I make data folder manually, error message changed to
Can't open the mysql.plugin table
Please run mysql_upgrade to create it.." and some files are created in data folder
I tried to upgrade by typing mysql_upgrade but it failed.
mysql_upgrade: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) while connecting to the MySQL server. Upgrade process encountered error and will not continue.
How can I solve this issue?
Clear the "data" directory, then run command mysqld --initialize, and the command net start mysql, bingo!
1.For the error,
2003: Can't connect to MySQL server on 'localhost' (10061) while connecting to the MySQL server. Upgrade process encountered error and will not continue.
I ran the cmd as administrator and then go to \Program Files\MySQL\MySQL Server 5.7\bin\, and run
mysqld install
2.For the error,
C:\Program Files\MySQL\MySQL Server 5.7\bin>net start mysql
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
Try
mysqld --initialize
and then
net start mysql
Thanks to Athan's answer. Those combination worked for me.
I also had the same problem and I wasted hours solving the issue, but in the end this worked.
Go to you C:\ProgramData\MySQL\MySQL Server 5.7 and copy the my.ini file from there.
Go to C:\Program Files\MySQL\MySQL Server 5.7 and paste it there.
Open cmd and run net start mysql
It would work like a charm.
Explanation:
MySQL couldn't find my.ini, therefore tried to create data in Program Files... where it had no rights to do so, therefore it says access denied every time you run it.
This is old but I was running into the same problem you were seeing. I thought I'd share this answer for anyone looking. I created the data directory as you did initially and tried to start the service and got "Can't open and lock privilege tables: Table mysql.user doesn't exist." I then deleted the contents of the data directory and instead initialized the data directory by running the following command from the bin folder.
mysqld --initialize [with random root password]
mysqld --initialize-insecure [without random root password]
I had the same error, after checked this document: https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html
I just clear data directory and add the --console option to initialize:
bin\mysqld --defaults-file=C:\my.ini
--initialize --console
Hope this help
MySQL Server can either be run as a Program or as a Service. You cannot run both. You should stop 'mysqld' Server Program before starting 'mysqld' Server as Service.
The 'mysqld' Server Program can be stopped either by typing
'CTRL + c' or by issuing
'mysqladmin -u root -p shutdown' command and issue the password when prompted.
You need download from https://dev.mysql.com/downloads/mysql/ previous GA versions, and after that copy directory "data" to your new mysql or outher directory what you write in configfile my.ini in directory mysql-"version" .
For your error, main cause is in your my.ini setting.
Since you are installing MySQL on Windows, you should define path like:
basedir = C:\\mysql-5.7.10-winx64
datadir = C:\\mysql-5.7.10-winx64\\data
These slashes must be doubled.
Then start your MySQL service again. I guess this time would work.
And here is official document from MySQL.
This saved my life,
Just turn off the windows firewall and Give he port number correctly as 3306 as default, then restart MYSQL server . After that turn on the windows defender firewall
Just work it fine.
Looks like my solution is not added yet,
I've installed mysql80 , edited my.ini in windows notepad and got the same error like topic author "... NET HELPMSG 3534." when I start mysql service,
and my issue was in extra bytes added by notepad at the begining (EB BB BF) on my.ini, when I edited (added the same changes) my.ini in other editor everything worked fine.

Location of database tables - MySQL - Windows XP

All,
This is the first time I am using MySQL and hence listing all the steps. This is actually a reinstall of MySQL since my 1st attempt had failed.
I have installed the latest version of MySQL Community Server on my machine. The installation folder is C:\Program Files\MySQL\MySQL Server 5.5 . The data folder resides in this folder path itself. I have created few tables in the MySQL command prompt by:
1 > Going into MS DOS Prompt.
2 > Making C:\Program Files\MySQL\MySQL Server 5.5 as my current directory
3 > Entered command: mysql -u root -p
4 > Entered password
5 > Placed my script file(.sql) which creates new tables in the folder C:\Program Files\MySQL\MySQL Server 5.5\bin
6 > In the command prompt, typed source <scriptfile>.sql
7 > Now, I get warnings for few tables. But when I enter command SHOW TABLES, all the tables in the script file are shown.
However, I am not able to locate the tables created in form of directories/files on the drive. The data folder does not contain my tables as well.Can anyone please tell me where are the tables located?
On Windows 7, the data directory is, by default, "C:/ProgramData/MySQL/MySQL Server 5.5/Data/". Note that "C:/ProgramData" is a hidden directory.
In windows 8(dont check in other OS)
Enter mysql in command prompt by
mysql -uusername -ppassword
Then type
select ##datadir;
mysql> select ##datadir;
+---------------------------------------------+
| ##datadir |
+---------------------------------------------+
| C:\ProgramData\MySQL\MySQL Server 5.6\data\ |
+---------------------------------------------+
1 row in set (0.00 sec)
Another way!!!
Go to C:\ProgramData\MySQL\MySQL Server 5.6\my.ini and there you can find datadir.
Be sure it is in ProgramData, not in ProgramFiles.
Go into your C:\Program Files\MySQL\MySQL Server 5.5\my.ini and find the variable "datadir".
This is your Data dir ;)
the table files are located in the \data folder. if you have not overriden this path when you were installing or if you have not modified the path in the my.ini config file after the installation. there are gui tools available for mysql that can help you do things easily.
C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/
Is the default DATA directory in XP.

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.