MySql password doesn't work after restarting windows - mysql

I'm having an awkward issue here. I've recently installed MySql on windows 7. Based on things I have googled, when you first install MySQL it shouldn't ask for a password. For some reason it did on my system.
I used the method described in the link below to reset my root password:
http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
It works. However apparently the password is lost every time I restart windows. Therefore I have to reset the root password every time I restart windows.
Any Ideas what I could be doing wrong?
Thanks in advance
Additional notes:
When I type
--init-file=C:\\mysql-init.txt
in the command window, I get the message "starting process 1960...." however it apparently freezes there and I won't be able enter further input into the command window. However when I open the MySQL workbench everything works fine.
On the other hand when I use this:
mysqld
--defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 5.7\\my.ini"
--init-file=C:\\mysql-init.txt
The command window doesn't freeze, but when I open the MySQL workbench I can't connect.
Additional notes2:
After following the steps in the link if I try to start the service from the "Services" window I get an error:
Windows could not start the MySQL 5.6 service on local computer. Error 1067: the process terminated unexpectedly.
Again everything works fine if I manually open the MySQL workbench, however I do get this error when trying to start the service.

Related

Trying to Start MySQL Server and Getting "Could not start server: argument 2: <class 'TypeError'>: wrong type"

I just installed MySQL using the community installer in hopes of running a server and creating a database for use in my C++ program. I installed the Server, Workbench, Shell, Router, and Connector/C++ before running the Workbench. Everything appeared to be working properly. The server was running and I was able to connect to it in my C++ program, so I started to create my database, when the power suddenly went out before I could finish.
Once the power came back on and my PC rebooted, I reopened the MySQL Workbench to find that I was unable to start the server. I clicked the 'Start Server' button several times, but was met with the error "Could not start server: argument 2: <class 'TypeError'>: wrong type".
I tried uninstalling and reinstalling everything, but when I reopened the MySQL Workbench after the installation was finished, I was met with the same error. Does anyone know what could have possibly happened?
EDIT: After uninstalling everything and deleting every trace of MySQL from my computer, I was able to reinstall everything and get the server running again. However now I'm getting the same error when I try to STOP the server: "Could not stop server: argument 2: <class 'TypeError'>: wrong type". What is going on????
I have the same issue and I've installed the developers default version of the MySQL-Workbench with the installer. I recently updated my hardware and reinstalled Windows 10, maybe it's a bug of Windows 20H2 or of the Workbench itself?
I found a workaround: Use the CMD or the Powershell to start or stop the MySQL-Service of the server. In my case, it has the name MySQL80. Take a look in your services of windows when the commands below are not working.
Use net start MySQL80 to start the server.
Use net stop MySQL80 to stop the server.
Remember to open the CMD or the Powershell as Administrator. I think this issue is a bug of the workbench itself because the service is start and stopable with the command line.
The first thing to try is to run mysqld --console from the MySQL server bin folder. That should give you more specific error messages.
In my case, the data folder was missing. I needed to run one of the mysqld --initialize... commands; see https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html. On Windows, running mysqld --initialize... --console helps to see what server is doing.
Once that's done, you can run mysqld --console again to see if it starts successfully.
I solved this problem as follows. currently my.ini file encoding is UTF-8. you must change to ANSI.
I've done numerous suggestions and none work. Except this one:
Download and run the latest MySQL Installer.
A window will appear showing your installed services:
MySQL Server
MySQL Workbench
MySQL Shell
etc.
Click "reconfigure" on the MySQL Server and set up the server as you did previously.
My specific server setup was:
Type and Networking: leave as default
Authentication Method: (RECCOMENDED)
Accounts and Roles: Enter and check mysql password
Windows Service: Uncheck 'configure as a service'
Apply configuration: Execute
Server should be up and running.
in my case I had solve this way
Go to RUN----->Services.msc----->MYSQL80---->start server
hope this way problem will solved.
On my Windows installation the account the service runs under did not have (security) permissions to the non-existing data directory. After creating the data directory which was "Program Files\MySQL\MySQL Server 8.0\data" and setting permissions everything worked with a "net start mysql80".
Here are the steps I took to resolve my MySQL Workbench 8.0.23 issue
that resulted in an inability to start & stop the MySQL server process (mysqld)
from MySQL Workbench (O/S=Windows only answer)...
Close MySQL Workbench
In C:\Users<Your account>\AppData\Roaming\MySQL\Workbench\serverinstances.xml:
Replaced:
sc start MySQL80
sc stop MySQL80
With:
net start MySQL80
net stop MySQL80
Notes:
My mysqld service was installed w/ the name='MySQL80', replace/match this value to your actual service name.
My mysqld service was installed using a 'Network Service' account, verify that your service is also running as a network service before using the 'net' commands
Setup MySQLWorkbench CE 8.0 executable to 'Run As Administrator' so that the commands to start and stop the service run as an administrator:
In File Explorer find the MySQLWorkbench.exe executable:
E.g: C:\Program Files\MySQL\MySQL Workbench 8.0\MySQLWorkbench.exe
In File Explorer, Select the exe, Right click on the exe, select 'Properties', select
'Compatibility' tab: specify 'Run This Program As An Administrator'
Start MySQL Workbench
Attempt to start or stop the MySql server process (mysqld)
Notes:
O/S = Windows 10 specific
MySQL & MySQL Workbench were installed via the MySQL CE 8.0.23 installer
Installed MySQL 8.0.23 as an upgrade from 5.7 to 8.0.23
If this error while starting/connecting the server from Workbench then you need to Go Start->MYsql workbench Installation Click.
Open and reconfigure the MySQL server with port number and Create Root user Password.
Finish this Re-configuration then open workbench. Provide the Port number and Credentials and connect to DB.
In window you may use task manager
just open task manager by search "task manager" in window search
Go to service and find Mysql (name depending on the name saved when initializing mysql server at first time)
Right click it and click start to start server or stop to stop server

MySQL 8.0 Command Line Client starts and stops immediately

I have started this SQL Tutorial: https://www.youtube.com/watch?v=HXV3zeQKqGY&t=3466s and I installed MySQL and when I try to launch MySQL 8.0 Command Line Client it starts and stops immediately. I want to specify that during the instalation it never asked me to set a root password for the database like it asks the person in the video.
For whoever has this problem, just open your mysql-installer-web-community-8.0.22.0.msi without uninstalling and press reconfigure next to MySQL Server. Now it gave me the option to set a root password and the client starts normally

MySQL not downloading correctly

I downloaded the MySQL Workbench 8.0 CE and can't connect to local host. I tried to make a connection and when I 'Test Connection' I get hit with an error message of 'Failed to Connect to MySQL at 127.0.0.1:3306 with user root' with 'Unable to connect to localhost' below it. I tried to find ‘MySQL’ in system preferences->services but it doesn’t come up. Someone suggested that means that it didn’t download properly but I don’t know why it didn’t download properly. I have tried to redownload it several times now and the connection issues keep happening. I am working on Windows. Someone suggested typing 'mysql -h localhost -P 3306 -u root -p' into the terminal. Do they mean the command prompt? Then I tried typing 'netstat -lnp | grep 3306' into the command prompt and it said 'grep' is not recognized as an internal or external command.
If anyone has any help I would really appreciated it. I have been lost for several days now and have no idea why this isn’t working.
Thanks
I would say that this might fix your problem,
try to uninstall all the previous installation like workbench or xampp or any other app that you might use for MySQL, using revo uninstaller or IOBIT , something like that.
Download xampp app from this link https://www.apachefriends.org/xampp-files/8.0.0/xampp-windows-x64-8.0.0-3-VS16-installer.exe and then install it,
it will show a warning but hit ok and next.. and leave it finishing installation,
allow its access and hit start on them booth and see if thet work , on apache and MySql,
then to test it properly go to web address on local host http://localhost/phpmyadmin/ (after running the xampp apace and MySQL services)
As you see there it looks that everything is working fine,
Now we start with workbench (close all services to make sure that
they wont cause any error, just stop booth 2 of them)
I would highly recommend you the community version, on this link https://dev.mysql.com/downloads/file/?id=499590 405MB file,
Click next,
There will be a warning about visual studio and python, but I guess it will be ok, you didn't mentioned that you are working with any of them
Click on execute and finish them installing successfully.
Now you hit next and create a password ex: localhost123#MYSQL
And hit execute,
Execute and finish
And you start the workbench, meanwhile start the services of xampp and start workbench, running xampp it gives me an error,
Go to task manager and kill this process as shown: then close and reopen xampp, then start services, check on localhost to ensure and open workbench again,
and check it

MySQL Workbench: "Can't connect to MySQL server on 127.0.0.1' (10061)" error

I apologise.. I know this question has been asked many times before, but I've tried lots of suggestions, and simply can't find a solution.
The problem: I have a MySQL database running on a hosted server.
I have to use SSH to connect to it, and I have the relevant Public and Private Key files.
I specifically want to use the PC version of MySQL Workbench, to access this database, for running queries, checking data, etc.
If I run Sequel Pro on a Mac, it connects fine, and I can browse and query the database. No problems.
If I run the trial version of SQLyog on a PC, it also connects fine. No problems.
But if I try to connect use MySQL's own "MySQL Workbench" application, using exactly the same settings and SSH Private Key file, it refuses to connect, throwing the well-known error:
Can't connect to MySQL server on 127.0.0.1' (10061)
I find it frustrating, as, in SQL Workbench, I specified the "MySQL Hostname" to use, db01.mysql.vm.MyHostingServer.net, but Workbench seems to ignore it, and demand to connect to 127.0.0.1 instead.
(I have read that Workbench says it needs the Public key file, but actually means the Private key file... and I have tried with both. I've also tried with MySQL Workbench on a Mac, but that crashed all over the place, simply when I was typing in server names and passwords.. it was a mess !!)
The hosting service I've gone with gives me limited permissions for changing MySQL settings, and given that Sequel Pro and SQLyog can connect successfully, I don't want to start messing about and changing things randomly.
Any ideas...?
Maybe you are not allowed to start the service "MySQL 55". Set the login information of Service "MySQL 55" as local!
To see the list of aviable services in Windows 7:
Open a run box
Type services.msc and press return.
Find the service MySQL55
A right click of the MySQL55 Local Service shows Properties -> Log On
Even I had same problem, The reason was mysql service was not getting configured properly, when I installed it through 'MySQL installer'. Also it was not starting, when I tried to start the service manually.
So in my case it seemed be a Bug with the 'MySQL Installer', as editing the install path to a different one when the 'Developer default' was selected, the problem occurs.
Solution (Not exactly a solution):
Uninstalled the MySQL all products (completely)
Reinstalled, this time also I have selected 'Developer default', but didn't make any changes to the path or any thing. So the path was just 'C:\Program Files\MySQL' (the default one)
And just clicked Next Next...
Done, this time MySql was running fine.
After making above improvement such as checking if mysql service is running or not, you just need to give a small password while creating connection, it is ' ' or 1 time press on space-bar in case of GUI or workbench. After which you just need to validate your machine with server (validated HOST). For that purpose click on 'New Server Instance' and it will configure server/HOST on your behalf itself.
I have done this successfully just a few couple of minutes ago. My workbench software is able to show all pre-installed databases etc now.
hope it will work for you as well.
Thanks!!!
I was having same issue, way i have resolved is:
opened the MySQL installer. i was having a Reconfigure link on MYSQL Server row.
Clicked on it, it does reinstalled MySQL Server.
after that opened MySQL Workbench, and it was working fine.
Try placing the host name (db01.mysql.vm.MyHostingServer.net) in your windows host (C:\windows\system32\drivers\etc\host) file along with it's IP address and port number and see if that helps.
If you have installed WAMP on your machine, please make sure that it is running. Do not EXIT the WAMP from tray menu since it will stop the MySQL Server.
To connect to a new server, you click on home + add new connection. Put IP or webserver URL in new connection.
Just try to run the following command manually:
C:\wamp\bin\mysql\mysql5.6.17\bin\mysqld.exe --console
It worked for me :)
Ran into the exact same problem as OP and found that leaving the "MySQL Server Port" empty in the MySQL Workbench connection solves the issue.
I have tried all the method.
I will suggest you to reinstall it.

MySQL command line won't open?

I just installed the latest version of MySQL. Until Now I had it on Windows XP but I wanted to install this on another computer with Windows 7.
Even after configuring everything correctly, the MySQL client won't show up in the Start Folder. So I went to the bin folder of MySQL and tried opening mysql.exe but it would immediately close down.
I then tried opening mysql.exe in cmd & this is what I get
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: N
O)
Any Ideas how I can get this to work?
Provide username (root)
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot
Default passsword is blank, but if you set it, you will need to provde password as well
I don't recall where I first read it, but when facing this problem before, I found that I had to manually turn on a service:
Windows key+R and type Run and hit "enter"
Type "services.msc", hit "OK"
Find "MySQL56", right-click and choose "Start"
You should now be able to log in with no trouble
That's the solution that worked for me; hopefully it helps others out there.
What #Herschel said is right if you follow his steps 1-4 then try to log in with your password in command line you'll have no trouble.
You can also make this run automatically as a service, something which you need when running it on a server.
Open Run
Type "services.msc" click ok
Find the MySQL service
Right-click properties then go down to startup type:
Change it to automatic
I followed these steps and it worked for me:
1. Open Command prompt in admin and go to the location of Mysql bin folder and type -
C:\ProgramFile\mysql\bin>mysql -u root -p <password>
2. Then the prompt asks for the password. This is the password or the root user which
you had set during installation of mysql.
3. Type the password and you will login in to mysql.
4. Also make sure your mysql service is running in the backend by going to the
windows service panel and check whether the mysql service is running.
Heyoo Heyoo. So as of today 19th March 2022 I had this same issue but imma show you how I solved it. My specs before we start:
MySql Version: 8.0
OS: Windows 10
OS Build: 19044.1586
Alright, I'm fairly new to SQL, was following along with a tutorial but when it got to the point of opening the client command line it wouldn't open, it just popped up and closed back; didn't even ask for a password. After watching several tutorials (which were very unhelpful) I noticed from those tutorials that the solution they proffered was to "Active the MYSQL80 service", but that was unhelpful to me because I couldn't see that service in the services menu.
So I decided to go back to the "MySql Installer -Community" App (I installed the community version of SQL)
After the installer had opened up I clicked on the "Reconfigure" action for MySQL Server
It opened the configuration window for the SQL Server and I followed the configuration process to set up the server (turns out I didn't initially set it up when I installed MySQL 😅😅). After the configuration process was done I went back to the services menu to see if the "MYSQL80" service was there... and it was, I checked to see if it was running; following the instructions from this tutorial. After making sure the service was running I went back to the client command line, it finally opened up, allowed me to input my password, and it's working properly!!