Skip to content

Instantly share code, notes, and snippets.

@sskanishk
Last active September 7, 2022 02:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sskanishk/8222305e23d14d841778e265f99746f9 to your computer and use it in GitHub Desktop.
Save sskanishk/8222305e23d14d841778e265f99746f9 to your computer and use it in GitHub Desktop.
Setup MySQL in AWS Cloud9

Open EC2 Cloud9

$ sudo service mysqld start

$ /usr/libexec/mysql55/mysql_secure_installation

comment - if first time Set root password? [Y/n] $ Y

Remove anonymous users? [Y/n] $ Y

Disallow root login remotely? [Y/n] $ Y

Remove test database and access to it? [Y/n] $ Y

Reload privilege tables now? [Y/n] $ Y

$ mysql -uroot -p

@sskanishk
Copy link
Author

to open mysql command line.
$ mysql-ctl cli

@sskanishk
Copy link
Author

ERROR - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Multiple mysql processes were running concurrently. First kill the processes with:

sudo pkill mysql or sudo pkill mysqld

restart mysql sudo service mysql restart or sudo service mysqld start

login again mysql -u root -p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment