I created a database named auth yesterday in mysql.
Today, I went to access it by USE auth; but I got this output
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'auth'
I never used to have this problem when I created and used databases.
Connect to database with root
mysql -u root -pyourpassword
(change yourpassword with password you have for root or leave in blank in case you havent set it). Now you should have access to your db. Check this thread how to set permissions for users MySQL Add User Guide.
maybe try creating and using a new database to see if the problem is repeatable, or if it's specific to that database.
Related
I just installed Wampserver and I'm trying to create a new database but once I type a name for it and click create, I get this error "#1044 - access denied for user ''#'localhost' to database".
I would appreciate any help.
When you login to MySQL, phpMyAdmin you have to use a real account.
WampServer sets the root account up without a password, so
Use Username = root
And leave Password = [blank]
Also WAMPServer installs both MySQL and mariaDB. Both are actually activated by default, so either disable the one you dont want to use (and switch the other to use port 3306) Or make sure you select the correct DBMS in the dropdown on the phpMyAdmin login page
I'm trying to connect to a mariadb server remotelly using terminal, but I get a little issue about that.
Preconditions
I have connection to my remote server, and I can enter inside maria db using the next command
mysql -u root -p**** and I enter without problems.
Also I have commented this line of my.conf from the #bind-address = 127.0.0.1.
When I'm trying to do this from my computer mysql -u root -h mariadb.testing.des -p**** I get the following error in console
ERROR 1045 (28000): Access denied for user 'root'#'mariadb.testing.des' (using password: YES)
Why am I getting two different results using the same user? What am I doing wrong?
Thanks for the help,
Jaster.
It's not enough to ensure your server is reachable from remote. You also have to create a user which has privileges for the remote access to your desired schema. I strongly recommend not to create a remote root user with access to all. Best practice is to create a remote user for every single scheme.
In example:
CREATE USER 'jeffrey'#'my.remote.host' IDENTIFIED BY 'mypass';
GRANT ALL ON jeffreys_db.* TO 'jeffrey'#'my.remote.host';
See also:
https://dev.mysql.com/doc/refman/5.7/en/create-user.html
https://dev.mysql.com/doc/refman/5.7/en/grant.html
I wanted to setup my owncloud installation on my raspberry pi 2. So, I created an mysql database and user.
CREATE DATABASE owncloud;
CREATE USER 'owncloud'#'localhost' IDENTIFIED BY 'Password';
GRANT ALL PRIVILEGES ON owncloud. * TO 'owncloud'#'localhost';
FLUSH PRIVILEGES;
After I type all nessesairy parameters into the webinterface of the owncloud-setup, I recevied:
Error while trying to create admin user: Failed to connect the database: An exeption occured in driver: SQLSTATE[HY000][1045] Access denied for user 'owncloud'#'localhost' (using password:YES)
Sadly, my resent sreach on similar topics didn't result in any functional hint on this problem. So, I would be happy about further suggestions.
Look at this: https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html#database-choice
In Terminal: mysql_upgrade --force -u root -p
Use administrative MySQL »root«-user and password with the Installation Wizard
Check that the Database not exist which you create with the Installation Wizard
If nothing helps, start with sqlite, then migrate to mysql like this: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html
Just replace localhost for 127.0.0.1 in Owncloud's setup form for MySQL as mentioned in comments above by Askaga
For some reason, explicitly re-access the database from the terminal solves the problem for me. Just give mysql an empty line with
mysql -u root -e ";"
This should be an individual command after you created database and database user.
Sure, you should always check whether
There are users with an empty username. Remove them.
Remove "test" database.
Grant appropriate permission to your database user.
Last but not least FLUSH PRIVILEGES;.
Search other posts for instructions. I'm just providing a possible solution if you come across a situation where none of the above works.
Here's a good example to properly setup mysql after installation. FYI.
Mask the DB password in the installation screen (the password should not be visible, only dots) and retry.
Ubuntu 18.04.1, Owncloud 10.
Check the contents of config.php in my case located at /var/www/owncloud/config/.
Specialy items dbuser and dbpasswrd.
Read config.sample.php in the same directory for info.
I want to create database in mysql I installed MySQL 5.6 in windows 8, During installation installer never asked me username or password. When I'm executing command "create database ivs;" it gives me following error:
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'ivs' what can I do now?
You have use the default User and not root. The default User dosent have enough right to Create Databases. Start the Client with root User
c:> mysql -uroot
After great discussion with #Bernd Buffen I got solution for my problem, when I use 'create database ivs' I actually not logged in with 'root' user (I'm logged in with guest user) so to change this to root I use following command:
C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysql -uroot
and then I use
mysql> create database ivs; to create database named 'ivs'
I have to create a database in a Windows Server 2008 remote machine, which already had MySql Server 5.5 and MySql Workbench 5.2 installed. Since I wasn't granted the password to the root user, I tried to create a new user.
In MySql Workbench I tried to open the Manage Security option, to no avail, since it asked for the password.
In the command prompt I tried to run mysql but it returned the following error message.
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: NO)
Is there any way to create a new user without having prior access to the root user?
More generally, is there any workaround to create and use a database without access to root?
You don't have to be the root user, but you must have rights to create a user. You can get those rights with the grant create user statement. Apparently, you don't have those privileges, so if you need them, you should ask your administrator.
So the answer is: There is no workaround. You don't have to be root, but you must have certain privileges.
In practice, if you need an extra user, the administrator is more likely to create one for you than to give you the rights to create them yourself. But that's something he and you need to figure out yourselves. :)