phpMyAdmin "Create database: Documentation No Privileges", how to create database? - mysql

I'm just starting to learn php and mysql, and just trying to set everything up. To try out example problems for learning, I'm trying to create database by logging into the http:://my-local-ip/phpmyadmin/. I can login using the user-name and password used during installation, but trying to cretae database I see No Privileges.
I have looked at the possible duplicates, I have tried clearing cache/cookies and entering flush and the user command sql, they have not fixed my issue.
Note that, I'm not on the same computer, I have a separate computer that I'm ssh-ing into (both ubuntu 16) and I'm accessing the web-phpMyAdmin via the local ip address of the ssh-ed computer.
I'm not sure how to fix this issue.

This solved my issue, on ssh-ed terminal, I ran:
sudo mysql
and on the prompt:
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'myUsernameCreatedEarlier'#'localhost';
Then I cleared the cache/cookies on the browser on my computer (not the server computer). And logged in on the phpMyAdmin web portal. Now I have database creation access.

Use these commands for mariadb with phpmyadmin:
sudo mariadb
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'#'localhost';

Related

Can't login to MySQL Server externally

I have an Ubuntu 16.04 server running on Microsoft Azure, and I have a MySQL Server running on that. I have 2 users, root and MattyAB (Me), which I created with this command:
GRANT CREATE ON *.* To 'MattyAB'#'localhost' IDENTIFIED BY '********';
GRANT ALL PRIVILEGES ON * . * TO 'MattyAB'#'localhost';
Where * is my password. I then try to connect to the server with my personal computer, but it doesn't work.
What am I doing wrong?
Do I need to change this #'localhost' to something else?
So I have ran into this problem with other things that I have done.
So you basically just need to run the following command after identifying what port your mySql runs on.
In Your Ubuntu Terminal. Run This
EXPOSE <PORT NO>
Try sudo expose if this does not work.
What have you done? You gave grants to access all databases and tables *.* at your server to the account
'MattyAB'#'localhost'.
Localhost obviously is not an extern account. As far as I know you have to use the '%' operator instead of 'localhost', or just the IP from which you want to log on to your mysql server.
You need something like this: GRANT CREATE ON *.* TO 'MattyAB'#'%' IDENTIFIED BY '******'; I am not sure with the single quotes around the %. In case of error try both types of syntax.
Furthermore you can take a look at MYSQL Grant Syntax.
With SHOW GRANTS FOR MattyAB you can check your grants configuration.

Using MySQL Workbench on Linux Mint 18

I've never had a MySQL install go smoothly. Not Mac. Not Windows. And now Linux joins the mess.
I installed mysql-server via Software Manager after a failed attempt with linuxbrew. I can actually run it in terminal, but I have to use sudo which seems odd. I don't see any examples where the user has to use sudo.
On top of that, when I run MySQL Workbench I can't connect. I get the error, Access denied for user 'root'#'localhost'
Any suggestions?
Did you install mysql from apt-get install mysql-server ? it probably asked you for a default root password (Ubuntu like systems usually do). If you have forgotten it, have no fear, the password can be reset
http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html#resetting-permissions-unix
Try doing this as linux root (sudo -i), if that doesn't work try
sudo -i
sudo mysql
and give it a shot.
Alternatively, sudo, connect to mysql and create another user account with full privileges something like
GRANT ALL ON *.* to someother user identified by ...
You cannot connect remotely with root database user since the default user created doesn't have access on '%' (remote access).
Create another user with limited rights (secure) and use it for workbench.
creating user on mysql:
create user test#'%' identified by 'test_user_password';
grant all on *.* to test; -- you can specify specific permissions/databases
flush privileges;
Try these credentials with workbench.
As far as the linux command line is concerned
mysql -uroot -p
-- hit enter, no password and see if you can get connected

Mysql connection from other computer to xampp server? Error 1045

There is much information about this error but seems nothing works.
So I try to access to xampp mysql-server using the user root from local network.
mysql -uroot -p -h 192.168.100.48 --port=3306 (connecting from other local computer to xampp server)
But even I put right password (which I use for root) it not work. It works only if I log in using same computer where the server is running. I can use other user which I have specified but not root user. Why?
So how to fix this problem and getting it working?
Does the root user have the correct permissions?
Check the first duplicate link below for full answer - credit to Michael Berkowski:
GRANT ALL PRIVILEGES ON *.* TO 'root'#'192.168.1.%'
IDENTIFIED BY 'some_characters'
WITH GRANT OPTION;
FLUSH PRIVILEGES;
Have you tried search SO first? There are quite a few questions like this.
Possible duplicates:
How to grant remote access permissions to mysql server for user?
Remote MySql connection from other server

Re-Enable localhost privileges on MySQL

I work with XAMPP and by mistake I deleted all privileges for localhost in MySQL so I can't use the localhost to GRANT ALL PRIVILEGES TO *.* root#localhost since I'm doing this in the localhost. I remember a User with full privileges and Its password but I can't do much since the localhost has no privileges at all and if I use the MYSQL Shell it tells me the same thing
I didn't enable remote access when I installed the XAMPP so it could be also a problem (Or maybe not and there is a solution within my machine).
Is there a way to access to mysql.user in some way to enable again the privileges for my localhost, or do it using the MySQL shell?
stop server
start server with –skip-grant-tables key
connect to server as root without password
edit privileges table:
USE mysql;
UPDATE user SET host='localhost' WHERE user=’root’ LIMIT 1;
FLUSH PRIVILEGES;
start server in normal mode
If you can restart MySQL server then follow these steps - How to Reset the Root Password.

Phpmyadmin - Mysql no privileges

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.