Setting root without password only for a single database - mysql

How to configure mysql [using phpmyadmin ?] to use one database by the root user without password ?
I have the root user with password. I need the root to access one database without password.

It's not possible to do that. A MySQL user is defined by a combination of host+username+password (not a database name).
Create another MySQL user. In the current phpMyAdmin version, this can be done via the Users menu.
By the way, it's not secure to have a username without password.

Related

MySQL - Restrict access to a database

Is there a way to restrict users from accessing a particular database/schema within MySQL?
I want to create a database/schema that only I can access.
I also want to change the password of the "mysql" user but I do not see this user in the mysql.user table even though I was able to use this user to login to mysql.
I tried changing the password of the user by executing the statement -
mysqladmin --user=mysql --password=oldpassword password "newpassword".
But now I am not able to login this user altogether. I've tried both the old and the new passwords.
I am wondering if my changing this password can impact any mysql service running on the system.
For restricting table and schema you can use the GRANT, you can set permission for each user or group on a particular tables for more details :
Tutorial on Grant for mysql
For your access the answer is already on stackoverflow :How do I retrieve my MySQL username and password?
Hope that can help you

How to define local user in mysql database without entering a password?

How would create another user in my mysql database so another person who is working on my rails application can also get access to the server?
Most articles I found on the question tell me to type in a command like "mysql --user=root mysql -p" that requires a password (https://dev.mysql.com/doc/refman/5.7/en/adding-users.html)
Is there anyway around this?
You can simply create an user without giving a password.
create user 'xxx'#'localhost'

how to establish remote MySQL connection from Rapidminer? user not known?

I want to connect to a mysql database from Rapidminer, I am not sure, but to have acces to databases, I have to execute a GRANT ALL string on my mySQL machine first, is that right?
it goes like:
GRANT ALL ON . to user#IPADRESS IDENTIFIED BY 'password';
where IPADRESS should be ipadress of my remote computer, and password is the password of the root login of my mySQL Workbench, is that correct?
but what is the user? I didn't create a user before, and I am trying from rapidminer...
Can you specify a little your question, because I am not sure, if I understand correctly you question.
But: every MySQL connection should have following things:
database name
host
username
password
table name
An user you can create from MySQL workbench, not from RapidMiner. I think, the same database can have multiple users with respective passwords.

can we keep same password for mysql and for some specific databse?

we use different password for specific database and for mysql.for instance, say root user password is 'root' and we have database whose password is also 'root', is it possible to use same password?
If you have the same user (same username and password) for all databases all will be compromised if one application is compromised since all applications are able to query data from all databases. Another reason for not using root when connecting from applications is to not have less privileges, like not having ALTER TABLE right, for the application

MySQL workbench - Can't connect to a specific database

I'm facing a strange issue here and it seems impossible to me to connect to my MySQL database.
I have used the workbench few times ago, but it was an older version. The problem with the new one (6CE) is that I can't connect directly to a database - it only allows me to create a connection to the server as a root user and I don't remember this password.
Is there a way to make a connection directly to the dataase itself as in the previous versions, or now only the root is an option. If yes I will have to reset my password.
Make sure that your credentials are still valid, and has proper privileges. If you can log into your mysql-server from terminal (with root account or the user you are trying with), then run "SHOW GRANTS" and see the privileges;
To connect to mysql database you need to have your user account's hostname specific to your IP or wildcard (%).
Similarly you can create a new mysql user with the following command from your server, and then try with this new user.
GRANT ALL ON <db>.* TO 'user'#'<ip or %>' IDENTIFIED BY '<password>' ;
FLUSH PRIVILEGES;
Be careful with the user created above. It will have ALL privilege with the specific database. And using % is actually a bad idea, so user you home machines IP (from where you are trying to connect with Workbench)