Posts

Showing posts with the label SQL

show databases and tables in MySQL

mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | django_db          | | mysql              | | performance_schema | | sys                | | test               | +--------------------+ 6 rows in set (0.52 sec) mysql> use test; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +----------------------------+ | Tables_in_test             | +----------------------------+ | auth_group         ...

How to set settings.py for MySQL in django

use the password you entered when installing MySql $ mysql -u root -p Enter password: Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.7.12-0ubuntu1 (Ubuntu) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE test; Query OK, 1 row affected (0.01 sec) mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | django_db          | | mysql              | | performance_schema | | sys           ...

MySQL Installation in Ubuntu

Image
To install MySQL, run the following command from a terminal prompt: sudo apt-get install mysql-server During the installation process you will be prompted to enter a password for the MySQL root user. Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:  sudo netstat -tap | grep mysql If the server is not running correctly, you can type the following command to start it: sudo service mysql restart Configuration If you would like to change the MySQL root password, in a terminal enter:  sudo dpkg-reconfigure mysql-server-5.5 The MySQL daemon will be stopped, and you will be prompted to e...

How to login MYSQL

Image
$ mysql -uroot -p<password> mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | cinder             | | glance             | | heat               | | keystone           | | mysql              | | nova               | | performance_schema | +--------------------+ 8 rows in set (0.14 sec) mysql> use keystone Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +----...