Running Mysql as root
the first step is to back up the data directory.
after you've done that, go ahead and make changes. just make sure you have a user named mysql (or specify a different one explicitly) and that they have proper permissions on the data directory.
this is a fairly secure operation and may result in loss of functionality or data. but just in case you have a backup!
source to share
The root user for MySQL is NOT the same as the root user for logging into the computer, so there shouldn't be any side effects if you grant mysql user rights on the production server.
This is the user mentioned in
$ mysql -u user -p password db_name
who could share the name with a user logged into the computer, but shouldn't.
EDIT: please note - a normal user can run mysql as root if the correct password is used in the command above. It won't be the same as root password if you know what I mean.
If this is not clear, you should definitely familiarize yourself with the meaning of "root" in the context of MySQL.
source to share
-
When you start your mysql shell, enter it as root as
C: \ xampp \ mysql \ bin \ mysql.exe -u root -p [password, if any];
-
If you don't enter a password after the '-p' in the command, it will prompt you for one. Just hit enter if you don't have a password (default) or enter a password if you've set one.
-
to check if you have a password or not, got to
http://localhost/phpmyadmin/
- you can find the credentials of the root user.
-
Once you connect, just check all databases as SHOW DATABASES; you will get a list of already existing default databases. This will be the final confirmation.
source to share