Skip to content

Instantly share code, notes, and snippets.

@leotm
Created December 12, 2016 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save leotm/0c6c0df98dc5854854e880e7e03b2055 to your computer and use it in GitHub Desktop.
Save leotm/0c6c0df98dc5854854e880e7e03b2055 to your computer and use it in GitHub Desktop.
Setup MySQL
# Check process with: ps -ef | grep mysql OR ps aux|grep mysql
pkill mysqld
mysqld_safe --skip-grant-tables &
mysql -u root
FLUSH PRIVILEGES;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('foobar');
quit
pkill mysql_safe
service mysql start
# now u good 2 go
mysql -u root -p # or
mysql_secure_installation
# Notes on shit i tried:
# /etc/init.d/mysql stop
# sudo dpkg-reconfigure mysql-server-5.7
# Deleted then remade /etc/mysql/mysqld.conf.d
# Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock
# cd ~
# echo "ALTER USER 'root'@'localhost' IDENTIFIED BY 'test';" > mysql-init.txt
# sudo mysqld --user=root --init-file=~/mysql-init.txt
# sudo mysql --user=root &
# sudo mysqld --user=root &
# mysqld start
# service mysql start
# service mysql restart
# Check: var/log/mysql/error.log
# chown -R mysql.mysql /var/lib/mysq
# telnet 127.0.0.1 3306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment