I'm getting an error:
mysqladmin.exe: connect to server at 'localhost' failed
error: 'Access denied for user 'ODBC'@'localhost' (using password: YES)'
I tried to grant privileges
mysqladmin.exe grant all ON *.* TO 'myuser'@'localhost'
I'm trying to create a database with:
CD C:\Program Files\MySQL\MySQL Server 5.5\bin
mysqladmin.exe create database comersus -p
I just installed MySQL 5.5.27.2 I created a user called myuser I'm working in XP Pro sp3
Please let me know the correct command line to (I think I need to grant permission first) Create a database file.
You will get this error when the user user_name does not have the right to access your MySQL database. To resolve the error, you must create a user with the following command: mysql> GRANT ALL ON *. * to user_name@localhost IDENTIFIED BY 'password';
How to fix “Error 1045 (28000) access denied for user 'root'@'localhost' (using password: yes)”? It arises when you perform a fresh installation of MySQL and try to login with a password. The default password of MySQL is blank () (i.e. empty string). So, you can login to the MySQL server using the same password.
Try running the mysql command with the following option:
C:> mysql -u root
This specifies the "root" MySQL user when you connect.
Because you didn't specify any user, it defaulted to an "anonymous" (unnamed) user. On Windows, the username is set to "ODBC" for some reason unknown to me.
Read this page (part of the tutorial) about connecting to the server.
And read the section of the docs starting at the link below, to learn more than you ever thought possible about users and privileges.
I got the same issue and find my solution.
Go to path MySQL/data. Under this folder check for (.err) ERR file. There may be temporary password generated as below.
[Note] A temporary password is generated for root@localhost: _yJU=h0P!E<0
Hope it helps some one.
I was able to create a database, Grant permissions and flush privileges to activate the new permissions in a batch file:
Start of MySQLrun.bat
@echo off
:: I had to use the root user because the user I created didn't have any authority
set user=root
::set user=MyUser
:: When I first installed MySQL I set a password
set password=MyPassword
set host=localhost
CD C:\Program Files\MySQL\MySQL Server 5.5\bin
:: Create a database file
:: The log will be in C:\Program Files\MySQL\MySQL Server 5.5\bin
mysql -h %host% -u %user% -p%password% < c:\Dnload\MySQLCommands.sql --tee=Run.log --comments --debug-info --verbose
cmd
End of MySQLrun.bat
The bat file runs the commands in the MySQLCommands.sql file:
Start of MySQLCommands.sql
drop database if exists MyDatabaseFileName;
CREATE DATABASE MyDatabaseFileName;
# An example of how to GRANT ALL privileges to a user
#grant all ON mydatabasefilename.* TO 'Myuser'@localhost identified by 'MyPassword';
# GRANT INSERT, DELETE, UPDATE, SELECT ON databasename.* TO ‘username’@'localhost’ IDENTIFIED BY ‘password’;
# To activate the new permissions, issue the following command:
FLUSH PRIVILEGES;
# How to log in to a specific database on a MySQL server:
show grants for 'MyUser'@'localhost'
End of MySQLCommands.sql
Please Note: All usernames, Database names and passwords are case sensitive.
There are many ways to create a database. This is just one of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With