Phpmyadmin - Mysql no privileges - mysql

I installed wamp 2.1 on windows 7. However when i open phpMyAdmin, I get the error, Mysql 'No Provileges'. I uninstalled wamp and reinstalled it a few times, but it doesn't help. Does anyone know how to solve this issue?
Also, when i tried creating a database from mysql console, i am getting the following error:
ERROR 1044 <42000>: Access denied for user ''#'localhost' to database 'a_db_name'

Thank God and to all helped.
Its simple.
Must! click logout icon in phpadmin page
In login page, type:
username:root password: (blank)
surprise. now you can happily create your database.

Are you logging into MySQL as root? You have to explicitly grant privileges to your "regular" MySQL user account while logged in as MySQL root.
First set up a root account for your MySQL database.
In the terminal type:
mysqladmin -u root password 'password'
To log into MySQL, use this:
mysql -u root -p
Edit:
To set the privileges manually start the server with the skip-grant-tables option, open mysql client and manually update the mysql.user table and/or the mysql.db tables. This can be a tedious task though so if what you need is an account with all privs I would do the following.
Start the server with the skip-grant-tables option
Start mysql client (without a username/password)
Issue the command
flush privileges;
which forces the grant tables to be loaded.
Create a new account with the GRANT command something like this (but replacing username and password with whatever you want to use.
GRANT ALL on *.* to 'username'#'localhost' identified by 'password';
Restart the server in normal mode (without skip-grant-tables) and log in with your newly created account.
Refer this MySQL docs.

Take a look at my topic regarding this issue, which takes some of the above.
MAMP mysql broken root user
You need to shutdown your mysql install and restart it from the command line properly like is indicated above. In my topic I have full clear instructions on how to do so. My instructions are for MAMP but you should be able to adapt it for your install.

Simple solution. Just find the icon right to "home" in PhpMyAdmin and click to logout. Then login using username "root" and password ""(blank). This will work accordingly.

username ought to be root and keep the password null(keep the password field blank)

right click on the wamp icon and goto mysql console.
Login with password if you have set any.By default the password is blank and username is 'root'
Once you are in mysql prompt execute
FLUSH PRIVILEGES;
now quit the command prompt and you are good to go.

in step 1 .inter your databasevery important.
in step 2 .select your database via all tables .
in step 3. backup type=replace & export.
in step 4 import database in my sql.
attention please:in import your database...
all table must view & selected in step 4.

Related

ownCloud Setup: SQLSTATE[HY000][1045] Access denied for user 'owncloud'#localhost' (using password:YES)

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.

no privilege in PhpMyAdmin from Wamp

I have been messing around trying to solve this problem for awhile now and I probably messed something up. I have been going around the forums and nothing has been working. First I forgot my password to root and used the command --skip-grant-tables to try to change it. I am able to login into root now on phpmyadmin with my password just being empty. On phpmyadmin it shows User: root#localhost. Then when I try to create a new database there is only a red x and is says No Privileges.
Also if I try to create a password to root I get an error that says - Can't find any matching row in the user table.
I saw on a forunm that said to run this code
select Host, User, Select_priv from mysql.user
but what I get it SELECT command denied to user ''#'localhost' for table 'user'
thanks for the help.
The following command can be used to set the password for the root user and grant all privileges:
UPDATE mysql.user SET Password=PASSWORD('NewPasswordHere') WHERE User='root';
GRANT ALL PRIVILEGES ON *.* TO 'root'#'localhost';
FLUSH PRIVILEGES;
Place this SQL code into a text file and save it some place convenient. Then, kill the SQL server. Open a command prompt and cd to the directory where the mysql-nt executable is stored. Execute this command:
mysqld-nt --init-file=sql-file-saved-above.txt
Kill the SQL process you just started and restart the server normally and all should be good. Depending on how you have phpMyAdmin configured, you might need to adjust its configuration if you have the root password saved there.
your best option is to set add a new user with a password and grant FULL privildeges, on you connection use the new user
Open PhpMyAdmin
select "Users"
underneath the know users is the option "add user"
add login information as required
tick the 2 boxes in the "database for users section"
now "Check All" in the Global privideges and click go, new user is then set up and you can use it as your new connection
go to Php My Admin home page of wamp
At the very top in grey you can see your connection is "localhost"
Underneath where you see your connection is local, are 10 tabs which are......
Databases |
SQL |
Status |
Users |
Export |
Import |
Settings |
Binary log |
Replication |
More
as you can see option 4 is "Users"

No privileges on wamp server phpmyadmin

I installed WAMP on Windows 8, and I'm having problems with MySQL privileges in phpMyAdmin.
Here, you can see the screenshot:
As you can see, there is no privileges tab, and I can't a create new database.
Solution:
Click on the User accounts tab
Click on a user account showing no privileges
Click on the Edit privileges link and tick all the check boxes
i just write UserName root and leave the password blank it work for me
Go to phpmyadmin webpage under user accounts tab and check if the root has all_privileges
and still if you are not able create db
Go to mysql console login as root and type: flush privileges;
now reload phpmyadmin page and you should be in synch
for no priviledge error, the solution is this:
It is not a file permission issue, the mysql user you logged in as doesn't have the right to create databases. You need to login as root for full permission, which I understand you are not. If I am not mistaken, the default password for "root" is empty (blank, nothing, ""), so try that. Once you are logged in as root in phpMyAdmin, you will be able to create databases or create another user with full permission.
kudos to:: http://www.theadminzone.com/forums/showthread.php?t=98676
Hey i just tried this and it worked type the "root" as username and the password you set during installation.
Worked
Your problem is your authentication. If you are accessing phpMyAdmin through WAMP, then you need to check the files in WAMP for the proper configuration.
You might be able to start the MySQL server with --skip-grant-tables option. Then access the Users tab in phpMyAdmin, and delete the password for root#localhost and root#127.0.0.1.
you just ned to enter the username as 'root' and leave password blank.
You will be able to create database.

Access denied for root user in MySQL command-line

I've just installed xampp, and am using command line to write mySQL.
I am using 'root' with no password and can connect to mysql but cannot CREATE DATABASE as I get the error 1044 access denied for user '' # 'localhost'. I am logged in as -uroot.
I have privileges in phpMyadmin to do what I want, but, in command line I seem to have no write privileges. I've looked at all the other related posts on this topic but to no avail. I cannot GRANT privileges as I have none anyway.
Are you logging into MySQL as root? You have to explicitly grant privileges to your "regular" MySQL user account while logged in as MySQL root.
First set up a root account for your MySQL database.
In the terminal type:
mysqladmin -u root password 'password'
To log into MySQL, use this:
mysql -u root -p
To set the privileges manually start the server with the skip-grant-tables option, open mysql client and manually update the mysql.user table and/or the mysql.db tables. This can be a tedious task though so if what you need is an account with all privs I would do the following.
Start the server with the skip-grant-tables option
Start mysql client (without a username/password)
Issue the command
flush privileges;
which forces the grant tables to be loaded.
Create a new account with the GRANT command something like this (but replacing username and password with whatever you want to use.
GRANT ALL on *.* to 'username'#'localhost' identified by 'password';
Restart the server in normal mode (without skip-grant-tables) and log in with your newly created account.
Refer this MySQL docs.
navigate do C:\xampp\mysql\bin\ and make sure the file mysql.exe is in that folder.
mysql -uroot -p
if dont have a password just press enter.
the prompt changes to
mysql>
do your mysql commands
By default there is no password is set for root user in XAMPP.
You can set password for root user of MySQL.
Navigate to
localhost:80/security/index.php
and set password for root user.
Note:Please change the port number in above url if your Apache in on different port.
Open XAMPP control panel Click "Shell" button
Command prompt window will open now in that window type
mysql -u root -p;
It will ask for password type the password which you have set for root user.
There you go ur logged in as root user :D Now do what u want to do :P
Gain access to a MariaDB 10 database server
After stopping the database server, the next step is to gain access to the server through a backdoor by starting the database server and skipping networking and permission tables. This can be done by running the commands below.
sudo mysqld_safe --skip-grant-tables --skip-networking &
Reset MariaDB root Password
Now that the database server is started in safe mode, run the commands below to logon as root without password prompt. To do that, run the commands below
sudo mysql -u root
Then run the commands below to use the mysql database.
use mysql;
Finally, run the commands below to reset the root password.
update user set password=PASSWORD("new_password_here") where User='root';
Replace new_password _here with the new password you want to create for the root account, then press Enter.
After that, run the commands below to update the permissions and save your changes to disk.
flush privileges;
Exit (CTRL + D) and you’re done.
Next start MariaDB normally and test the new password you just created.
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
Logon to the database by running the commands below.
sudo mysql -u root -p
source: https://websiteforstudents.com/reset-mariadb-root-password-ubuntu-17-04-17-10/
I had the same issue, and it turned out to be that MariaDB was set to allow only root to log in locally via the unix_socket plug-in, so clearing that setting allowed successfully logging in with the user specified on the command line, provided a correct password is entered, of course.
See this answer on Ask Ubuntu
I re-installed the ODBC connector msi and re-installed mySQL directly (aside from xampp) and it now works. It was a connector problem I think, as SHOW DATABASES wasn't actually showing my databases at all.
My 'root' login wasn't getting access to the DB, which made it seem like it had limited priviliges but it actually wasn't connected properly.
Server file only change name folder
etc/mysql
rename
mysql-
this might help on Ubuntu:
go to /etc/mysql/my.cnf and comment this line:
bind-address = 127.0.0.1
Hope this helps someone, I've been searching for this a while too
Cheers
You mustn't have a space character between -u and the username:
mysql -uroot -p
# or
mysql --user=root --password

unable to change to different user in mysql

I am also using windows 7.I installed mysql server 5.1.
Created a user as 'user#localhost' using mysql console. But unable to login to that user.
I tried to run using command prompt.
When I created a user with name "user". when i tried mysql -u user -p
It says Access Denied to 'user#localhost' ..
Even trying with mysql console is not helping out here. .
A few things to try:
Make sure your user has the correct privileges set (global or schema level privileges)
try running FLUSH PRIVILEGES
To help us troubleshoot, what does this command return? SHOW GRANTS FOR 'user'#'localhost';