MySQL Tutorial
Introduction Installation of MySQL Getting MySQL server information RDBMS Concepts Data Definition Language Data types Managing Databases Managing Tables Managing Views Inserting records in a table Updating records in a table Deleting records from a table Retrieving Records Data Control Language Variables in MySQL Procedures in MySQL Built-In functions in MySQL User Defined functions in MySQL Triggers in MySQL Cursors in MySQL Transaction control Event scheduler Tuning MySQL Server Performance Managing users Importing and Exporting data Database Testing Workbench PHPMyAdminInstallation of MySQL
Official website of MySQL is https://www.mysql.com/ MySQL is offered in various editions as mentioned below. Enterprise Edition Standard Edition Classic Edition Embedded Edition Community Edition For learning purpose, you should download the community edition. You can visit https://dev.mysql.com/downloads/file/?id=465371 and download the web installer. Note that you will have to install python before you start installation process of MySQL. When installation is completed, MySQL server starts running at port 3306 Default user id is root and password is blank. MySQL.exe is located in below directory. So you can add this path in PATH environment variable, so that you can use mysql command from the command prompt.
C:Program FilesMySQLMySQL Server 5.7in
To connect to MySQL from command line, you have to use below command.
mysql -u root -p
Then you have to press enter key. If you have set the password for root, you will be asked to enter the password. If everything goes well, you will be connected to the mysql. If you want to use the password in same command, you need to type it right after -p switch without space as shown in below command.
mysql -u root -pmypass
If you use incorrect password, you may get below error.
ERROR 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (using password: NO)
You also get below error if you execute below command.
mysql -u root
Note that -p switch is very important. Also do not try to enter the password in the same, otherwise you will get below error.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
After the connection is successful, MySQL version is displayed and then you can execute any MySQL command in the interpreter. To exit MySQL, you have to use exit command.Web development and Automation testing
solutions delivered!!