MySQL/Server: Difference between revisions

From Omnia
Jump to navigation Jump to search
No edit summary
 
(No difference)

Latest revision as of 05:31, 28 May 2017

Installation

sudo yum install mysql-server
sudo /sbin/service mysqld start
# sudo /usr/bin/mysql_secure_installation

Security

mysql -u root
use mysql;
truncate user;
truncate db;
grant all on *.* to root@localhost with grant option;
flush privileges;

If you screw up: [1]

/usr/libexec/mysqld --skip-grant
# in another window:
mysql -u root
use mysql;
truncate user;
truncate db;
describe user;  -- match columens
insert into `user` VALUES('localhost','root',,'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',,,,,0,0,0,0);
# kill and restart mysql