mysql access denied for user 'odbc'#'localhost' to database - mysql

I installed MySql5.5 and set password during installation but when I try to use mysql from windows command prompt, I have get the error:
access denied for user 'odbc'#'localhost' to database password = 'YES'
I would like to change it back into "root#localhost" as well as to reset the password but I can't log in mysql.
How do I login to mysql with root?

You're trying to use the mysql interactive shell? You can specify usernames at the command line:
c:\> mysql -u root -p
where
-u = specify username
-p = prompt for password

I fixed this by implementing a little hacky solution. Downloaded hxd (hex editor) and searched for 'ODBC' (there should only be one match) and just changed it to 'root'.

You are logging into mysql with a default no-rights user, you have to login as root if you want to do everything:
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql.exe -u root -p
Enter Password: *****
If you never specified a root password it should be blank, if you did, you have to remember what it was, or find out how to reset the root password.

Related

Problems installing openEMM on Centos 6 running Plesk 11

I am trying to install openEMM on a Centos 6 VDS and have run into a snag. I am following the instructions on this page: http://www.roothelp.net/install-openemm-on-centos-6-x/. Everything has gone along fine until I reached the following commands:
service mysqld start
/usr/bin/mysql_secure_installation
cd /usr/share/doc/OpenEMM-2013/
mysqladmin -u root -p create openemm
The service starts fine, but when I run /usr/bin/mysql_secure_installation I get the following:
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and you
haven't set the root password yet, the password will be blank, so you
should just press enter here.
Enter current password for root (enter for none):
This is where the problems start. Apparently Plesk 11 does not create a root user account, using "admin" instead. None of my passwords work here, neither my actual SSH root password, my admin password, or any other password I've assigned. I even started mysql with this script to ensure I had the correct root password:
>UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
>FLUSH PRIVILEGES;
I tried this to ensure I had the correct password: /usr/local/psa/bin/admin --show-password
None of this has worked, and I am unable to run the command. How can I get around this? If I skip that command (GoDaddy support advised me that it was only configuring MySql, which is already installed with Plesk) and try to run
mysqladmin -u root -p create openemm
I am again asked for a root password and none work. I also tried this command instead, using the admin password but still had the same problem.
mysqladmin -u admin -p create openemm
I suspect I'll have to create a database called openemm through Plesk. Any ideas?
If you haven't set the mysql root password you can set it through the command
`$> mysqladmin -u root password "yourpassword"`
and if you want to change (or update) a root password, then you need to use the following command:
$> mysqladmin -u root -p'oldpassword' password newpass
Then you can create your database. In your case I think the mysql root password is just entered as the secure script asked you.

MySQL command prompt doesnt require password

I have installed MySQL on my machine. I can log in by directly opening the MySQL 5.6 command line client from the start menu and it prompts me for my password. When I enter the correct password it lets me in, and if it's wrong, it kicks me out.
When I run MySQL from the command prompt, the ONLY way I can log in (using both root user or another user I have created) is to enter no password. If I enter my password it says access denied to root#localhost... yada yada ... using password:YES
so in summary if i type
mysql -u root -p
password: [mypassword]
it doesn't work, throwing the error Access denied, using password yes
However, if I do
mysql -u root -p
password: [blank]
it logs in. same behavior for any other user.
That makes no sense to me cause in every other application I have to enter a password to get in.
any ideas?
This is because the user root has no password by default unless specified during installation. Trying to login with a password is impossible if there is no password.

MYSQL error: 1045 (28000): Access denied for user 'root'#'localhost'

When I try to connect to the sql server and enter the following in command prompt:
shell> mysql --user=username--password=password db_name
I get error:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: Y
ES)
What does this error mean?
Looks like a space is missing between username and --password
If you don't know the root password, with Debian or Ubuntu, there is an easy way to reset it :
First, get the exact version of your server using
sudo dpkg --get-selections | grep 'mysql-server-'
Then, just use sudo dpkg-reconfigure mysql-server-5.x
(btw, replace 5.x with you real version number)
On a fresh install, the default root password is blank, so should be able to log in using just
mysql -u root
You should obviously add a root password after installation
mysqladmin -u root password [newpassword]
In most cases, you should also set up dedicated accounts with limited rights before working with a DB.
On Windows -
Search for services
Stop the service named MySQL[#] (in my case it was MySQL80).
Start the service again.
Open Command Prompt and type:
mysql [database name] -u [user name] -p
It worked for me when no other solutions worked. Hope this solves your issue as well.
It means your password is wrong or the account "root" has no access to the database on host "localhost".
Look at the right side bar. There are multiple questions equivalent to yours.

'Access denied for user 'root'#'localhost' (using password: NO)'

I'm trying to set the password of the user root but I'm gettin the error below, any idea?
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root#localhost |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'#'localhost' IDENTIFIED BY PASSWORD '*436576511F70A4E3B305E1AB8E209851945D8687' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> exit
Bye
root#tirengarfio:/var/www/rs2# mysqladmin -u root password foo,
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'#'localhost' (using password: NO)'
$ mysqladmin -u root -p password
Enter password:
New password:
Confirm new password:
password is to be typed literally. It's a command. You don't have to substitute password with your actual password.
# /etc/init.d/mysqld stop
Stopping MySQL: [ OK ]
# mysqld_safe --skip-grant-tables &
[1] 13694
# Starting mysqld daemon with databases from /var/lib/mysql
# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Set/Change password:
mysqladmin -u root -p password
Login to MySQL console:
mysql -u root -p
To exit the console:
.\q
when trying to run this command i got the same error
sudo mysqladmin create asteriskcdrdba
i simply add a few lines to the code
-u root -p
and pressed the enter key. i then typed my password and hit enter. Linux liked my command as nothing more was displayed
so maybe try
sudo <your command here> -u <username> -p
after that hit enter and enter your password
Those are all good answers, but don't quite touch the deep cause of the problem one most likely has if faced with the OP question. That is, not knowing the ORIGINAL "starting" password created during the installation time.
And all these command lines with "-u root ..." etc. imply knowing and using THAT password.
Now this part from the original installation message may help anyone facing the problem above:
Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
ie. when you want to use "mysql -u root -p" first you should see password
in /root/.mysql_secret
This is basically a more detailed version of a previous answer.
In your Terminal, go to the location of your utility program, mysqladmin
For example, if you were doing local development and using an application like M/W/XAMP, you might go to the directory:
/Applications/MAMP/Library/bin
This is where mysqladmin resides.
If you're not using an application like MAMP, you may also be able to find your local installation of mysql at: /usr/local/mysql
And then if you go to: /usr/local/mysql/bin/
You are in the directory where mysqladmin resides.
Then, to change the password, you will do the following:
At your Terminal prompt enter the exact command below (aka copy and paste) and press enter. The word "password" is part of the command, so don't be confused and come to the conclusion that you need to replace this word with some password you created previously or want to use in the future. You will have a chance to enter a new password soon enough, but it's not in this first command that you will do that:
./mysqladmin -u root -p password
The Terminal will ask you to enter your original or initial password, not a new one yet. From the above image you provided, it looks like you have one already created, so enter it here:
Enter password: oldpassword
The Terminal will ask you to enter a new password. Type it here and press enter:
New password: newpassword
Then the Terminal will ask you to confirm the new password. Type it here and press enter:
Confirm new password: newpassword
Reset or restart your Terminal.
In some cases, as with M/W/XAMP, you will have to update this new password in various files in order to get your application running properly again.
open my.cnf using following path
C:\xampp\mysql\bin
under # The following options will be passed to all MySQL clients
#password remove # comment sign if it is there password = "newpassword"
save file
close file
re-start mysql
Firstly, go to the folder support-files on terminal, and start the server
by mysql.server start,
Secondly, go to the folder bin on terminal or type
/usr/local/mysql/bin/mysqladmin -u root -p password
It would ask you for the old temporary password which was given to you while installing Mysql, type that and type in your new password and it would work.

Can't Connect to LocalHost Mysql Server

I recently installed mysql server and client, but I can't connect to the server. I get this message:
Access denied for user 'root'#'localhost' (using password: YES/NO)
Whatever I do i will always get the same message.
I tried commenting bind-address but still the same thing.
If you set up a password for the root user during installation, then start the mysql client with the -p option, mysql -u root -p, and it should prompt you for a password.
If there's no password set, leave the -p off and it should log right in.
If you've somehow forgotten what the root password is, you can fix it by following these instructions... http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html