Sunday, 16 February 2020

Connect to MySql (Local machine to RDS)

/Users/narendra.raghuwanshi/Documents/personaldata/credentials/devEnvirnment/
ssh -i narendra.raghuwanshi-dev.pem narendra.raghuwanshi-dev@10.254.192.70
sudo -su awsdev

If above is succeed 
 mysql -u pascaldev -p -h pascaldev.cpuz5conexqr.us-east-1.rds.amazonaws.com  -P 3306

Using our Local Machine
Check the DB is accessible or not to you 

mysql -h <Endpoint> -P 3306 -u -p


What to do when i will not able to connect from my localhost mysql
For MAC OS
  1. Open MySQL from System Preferences > Initialize Database >
  2. Type your new password.
  3. Choose 'Use legacy password'
  4. Start the Server again.
  5. Now connect the MySQL Workbench

Download MySQL Community Server

Access Database using Terminal
How to add MySQL to $PATH variable:
cd to your home folder
$ open -t .bash_profile
Try adding the following line to your .bash_profile file.
export PATH=${PATH}:/usr/local/mysql/bin/
Setting the MySQL root user password on OS X
$ mysql -u root -p
mysql$ ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Access DB using workbench in interactive mode:
Make sure your server is up and running: