Thursday, 19 November 2020

Access Mysql user without sudo in ubuntu command line

 First login in as the root user using sudo command

sudo mysql -u root -p password

CREATE USER 'newuser'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%' WITH GRANT OPTION;
or
GRANT ALL PRIVILEGES ON DatabaseName.* TO 'newuser
'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

now everything is completed, logout from the sudo user with Exit
or Ctrl + Z. Then try with 

mysql -u newuser -p password

No comments:

Post a Comment

The total number of locks exceeds the lock table size

 SHOW VARIABLES LIKE 'innodb_buffer_pool_size'; SET GLOBAL innodb_buffer_pool_size = 2147483648;  -- 2GB Note: The value is in byte...