MySQL Password Not Working - mysql

EDIT: I had MySQL installed twice on my machine (XAMPP & on its own)
When I enter my password into MySQL Command Line Client, it rejects my password, gives 1 beep and closes the window. Can anyone provide me with a basic troubleshooting list of steps (from simple to progressively more technical) to regain entry into MySQL once and for all. Also, can anyone tell me what can cause my password to suddenly be rejected? I am also running XAMPP and the MySQL service is both installed and running. Thanks in advance.
I remember when I first got this problem some months ago, if I recall correctly, I solved it by starting the MySQL service from Windows XP's Administrative Tool (something I did stopped the MySQL service and to this day I don't know what it was).
Now the problem has started back again but this time, when I checked Services, the MySQL service was already 'started'.
Any assistance will be appreciated. Thanks

I think I figured out why my password was not working. I had two versions of MySQL installed on my machine (XAMPP and MySQL 5.1). So I deleted the MySQL 5.1 and it worked.

For me (and my similar problem),
--password = mypass
didn't work, but
--password="mypass"
did.

Is there an error message when it rejects your password? I wonder if perhaps you are using an outdated client and running into this issue: http://dev.mysql.com/doc/refman/5.1/en/old-client.html

If you set mySQL to not begin running on startup, then you need to start it prior to attempting to login. This can be done via the command line, via the task manager if you configured it as a windows service, etc.
For example, here is an explanation of starting the service using cmd
Starting MySQL from the Windows Command Line | MySQL

Do you have the password for the root account? If so, try this from the command line?
mysql --user=root --password=your password here
or
mysql --user=root --password=your password here --database=MySQL

A bit too late but - If you have numeric characters in your password and are using the numpad on your keyboard, ensure that the numlock is ON. For some weird reason if you have numlock off MySQL will still interpret a keystroke. This wasn't very obvious to me since my laptop doesn't have a num lock indicator light, thats HP for yah :)

How to Reset the Root Password | MySQL
This is the services solution that was mentioned. Use this if you can't remember your root password.

I'd like to add another successful solution to this problem. I reran the installer (the msi), chose the repair option and everything was fixed.

My password suddenly worked again, so I took the following steps to change it:
Using Windows Command Prompt, navigate to MySQL's bin directory
Type: mysqladmin -uroot -p password yourNewPassword
Press Enter. You will be prompted for your password, enter it
If no error messages/beeps happen, your password was successfully changed
Log in using MySQL Command Prompt with your new password
What I don't understand is that WHY all of a sudden my password started back to work after approximately 24 hours? I wish I know so I can avoid this in the future.

Related

MySQL Change Password command run in MySQL on Ubuntu Server results in strange Character Changes in terminal

I'm running an Ubuntu Server with MySQL in VirtualBox and trying to change the password for a user.
I run:
sudo mysql -u root -p
to access MySQL. At this point, and with any other commands not trying to see a user's password, everything is working.
In MySQL ( ) I run:
SELECT * FROM mysql.user;
After I run this, the entire display and terminal change. The output and command line are both displaying strange characters. I run this command which works just fine. What gives?
SELECT user FROM mysql.user;
Here are the before and after screen shots:
Screen Shot Before,
Screen Shot After
Any help would be greatly appreciated. I have no clue why this is happening. Is this an Ubuntu thing, a MySQL thing or a VirtualBox thing? I'm a noob so this is just an uninformed theory but could it have something to do with MySQL authenticated_string and something to do with hashing?
It actually creates a change that persists even upon typing exit and hitting Enter, exiting MySQL and back to the Ubuntu command line where the weird characters are still showing.
EDIT:
I was following a blog tutorial and inserted <db-password> as the password when creating the MySQL user. I was supposed to insert an actual new password instead but figured I'd just use that. Are the <, - or > characters that I used when setting the user's MySQL password maybe causing this?
I believe this was a character encoding issue in MySQL because SELECT * FROM mysql.user WHERE user = 'root'; doesn't have the same issue. Because of that, I believe the issue only occurs at that one user's password data point where the <, - and > characters were used. Maybe someone else can provide a better answer explaining more thoroughly why this occurs. Specifically, I'm curious as to how this issue in MySQL is then able to affect the appearance of the Ubuntu Command Line once the MySQL shell is exited.

MySQL 8.0 Command Line Client crashes right after entering the correct password

MySQL 8.0 Command Line Client crashes right after entering the correct password. I have also checked in services and there is no problem there. I'm using windows
This might be because MYSQL service is stopped.
Open search bar in windows and type services
Open the services application and find MYSQL application.
Click on start
Now open sql command line and try entering password
It is because MySQL Server stop, may be you run another application that use the same port. Try to run MySQL Installer Community, and you will find the program that you have to reconfigure (blue text). Try to configure MySQL Server ant click Test Connection.
It's hard to tell with no debug output or error codes, but disabling ssl might do the trick:
mysql --ssl-mode=DISABLED --host=$MYSQL_HOST --user=$MYSQL_USER ....
I had the same issue, was looking through Google to find an answer and came here. Are you sure, that you provided MySQL password? The root cause of my problem was the fact, that I put the MySQL user instead of MySQL password (the root one). Now everything is working fine.
That could mean that the password is failing. Check CapsLock key.
Go to Control Panel and uninstall MySQL Server only, you don't need to unstall the other MySQL files.
As mentioned here, make sure you can see hidden folders and then delete the following folders:
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\ProgramData\MySQL
C:\Users<your-username>\AppData\Roaming\MySQL
Reinstall MySQL Server Package only
Select another password (looks like the current password is the problem)
Come here and vote me up :)
Do something nice for someone else ;)

MySql password doesn't work after restarting windows

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.

Setting up MAMP - changing password

New to php, mysql and apache, but not to html/css and web design. Have downloaded MAMP to create new joomla website offline (also fairly new to joomla).
Following instructions in MAMP documentation and dwuser.com/education/content/why-you-need-a-testing-server-and-how-to-do-it/ and other sources (though am wary of non-official sites and years old info). It seems all is installed correctly (the message says so).
Trying to change the password of the mysql root user via Terminal app (inexperienced in console work too, sorry). After entering the correct text and substituting new password I am prompted for a password. There's a grey upright box with a white circle at the spot where I'd enter this old password ('root'). If I switch away from the terminal window the box becomes an outlined version.
Have tried limiting the new pw to all lowercase (12 characters), putting in computer admin password, and also searching to find out what the box means (unsuccessfully).
Also tried continuing setup by changing the password in the config.inc.php file (just in case) but afterwards password error messages came up.
Searching on the password error part has shown others have had problems but the replies have been beyond me, hopefully my knowledge will advance in time.
I hope some kind person will point me in the right direction... please? (In fairly simple terms too please).
Many thanks in advance.
.....
more info via edit
In the console I am keying
/Applications/MAMP/Library/bin/mysqladmin -u root -p password [NewPassword]
and substituting a new password (random 12 character) for [NewPassword]. After 'enter', the following line shows
Enter password: "grey sq box here"
and at this point nothing can be entered in the console.
So I know something's already amiss.
Thanks for your help...
I'll try to explain as detail as possible.
I believe you can execute the terminal.
0.Move to mampstack folder
$cd /Applications/MAMP/
stop mysql service
$sudo ./ctlscript.sh stop mysql
Password:"your_macbook_user_password"
2.Command not to look at grant table(which requires password input)
$/Applications/MAMP/Library/bin/mysqld_safe --skip-grant-tables &
3.You can enter mysql root directly due to 2nd process
mysql -u root mysql
change the password with the update query
mysql>update user set password=password('new-passwd') where user = 'root';
quit the mysql
mysql>flush privileges;
mysql>quit
restart the mysql
service mysqld restart service mysql restart Try both

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!!