If you don't have MySQL installed on your droplet, you can quickly download it.
sudo apt-get install mysql-server
Once you have MySQL installed on your droplet, you can access the MySQL shell by typing the following command into terminal:
mysql -u root -p
Please run these command
ps -A|grep mysql
sudo pkill mysql
ps -A|grep mysqld
sudo pkill mysqld
service mysql restart
mysql -u root -p
SELECT * FROM mysql.user;
CREATE USER 'widget_cms'@'localhost' IDENTIFIED BY 'mypass'
SHOW DATABASES;
CREATE DATABASE IF NOT EXISTS widget_db
GRANT ALL ON widget_db.* TO 'widget_cms'@'localhost'
FLUSH PRIVILEGES
SHOW GRANTS FOR 'widget_cms'@'localhost'
Grants for widget_cms@localhost
GRANT USAGE ON *.* TO 'widget'@'localhost' IDENTIFIED BY PASSWORD '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4'
GRANT ALL PRIVILEGES ON `foo`.* TO 'admin'@'localhost'
DROP USER 'widget_cms'@'localhost'
DROP DATABASE IF EXISTS widget_db
Use widegt_db;
CREATE TABLE admin ( id INT(11) NOT NULL AUTO_INCREMENT, username varchar(50) NOT NULL, hash_password varchar(60) NOT NULL, primary key (id) );