How to reset root password?
pkill mysqld
mysqld_safe --skip-grant-tables
mysql --user=root mysql
update user set Password=PASSWORD('my_pass') where user='root';
flush privileges;
exit;
Create database and grant user
mysql -u root -p
my_password
create database my_db;
grant all privileges on my_user.* to 'my_db'@'localhost' identified by 'my_pass';
Import sql file
use mydatabase
source filename.sql
Export/Import database
mysqldump -u username -ppassword database_name > dump.sql
mysql -u username -ppassword database_name < dump.sql
Komentáre