Presentation is loading. Please wait.

Presentation is loading. Please wait.

MySQL Working on Turing.

Similar presentations


Presentation on theme: "MySQL Working on Turing."— Presentation transcript:

1 MySQL Working on Turing

2 Login to SSH  Log on to turing.csce.uark.edu using your UARK username and password.  Those who don't have the SSH client, can download that from university's IT site at 

3 Connecting to turing Enter host name as ‘ turing.csce.uark.edu’ , user name and leave the rest as it is. Host name – turing.csce.uark.edu User name- <UARK_username>

4 Enter your UARK password
It will login to turing through SSH.

5 Login Screen of turing After entering password

6 MySQL Login Screen Type ‘ mysql -u user_name -p ‘ EX: mysql –u rsahu -p Enter your mysql password (in file .my.cnf in ~username)

7 Login Prompt Screen of MySQL

8 How to change MySQL password
Users can have their own customized password to login to mysql After login to mysql, user should choose database then change the password of mysql that is prompted when user types mysql –u user_name –p Change database mysql> USE user_name; Update password mysql> SET PASSWORD FOR =PASSWORD (‘NEW_PASSWORD’); Example: SET PASSWORD FOR = PASSWORD(‘TYPE_ANY_PASSWORD’);

9 Change database mysql> USE rsahu; 2. Change password
mysql> SET PASSWORD FOR = PASSWORD (‘NEW_PASSWORD’); Users should write their own password in NEW_PASSWORD.

10 Operations on Table Before creating any table in mysql, you should choose the database. [ here you can only use the existing database, which is under user’s UARK user_name] mysql> USE <uark_username> ; For ex: mysql> use rsahu; It will print a message saying “Database Changed” DDL Commands: CREATE, RENAME, DROP

11 Create Table Mysql> CREATE TABLE table_name (columnname datatype[constraint [constraint name]]….); EX: CREATE TABLE Test1 (Test_Id Integer Primary Key, Test_name Char(5));

12 Inserting Values Into Table
If column list is present, the values to be inserted must match the number of type of the columns listed. If column list is not given, values for all the columns must be provided and it must match the column types. mysql> INSERT INTO table_name VALUES (column1_value, column2_value, …. ); mysql> INSERT INTO Test1 VALUES ( 1, ‘EX1’);

13 Displaying Contents of Table
To display all tuples of the table mysql> SELECT * FROM table_name; EX: SELECT * FROM Test1;

14 To display certain distinct tuples
mysql> SELECT [DISTINCT] columnlist FROM tablename(s) [WHERE condition]; EX: SELECT * FROM Test1 WHERE Test_Id= 1;

15 Renaming the Table mysql> RENAME TABLE tablename TO new-tablename;
EX: RENAME TABLE Test1 TO Test_1;

16 Delete Table Even though users delete the table, the schema would be there. mysql> DELETE FROM tablename [WHERE condition]; EX: DELETE FROM Test_1 WHERE Test_Id = 1;

17 Delete To completely delete all the entries to the table; however, it will keep the schema. Mysql> DELETE FROM table_name; EX: DELETE FROM Test_1;

18 To show the schema of Table
mysql> SHOW COLUMNS FROM table_name; Or mysql> DESC table_name; EX: SHOW COLUMNS FROM Test_1; DESC Test_1;

19 DROP To completely delete the table from database, users can use ‘DROP’ command. Mysql> DROP TABLE table_name; EX: DROP TABLE Test_1;

20 Show Tables in Database
To show all the existing tables in a database mysql> SHOW TABLES;

21 Log Out of MySQL and SSH Type two time ‘ exit ‘ , it will log out of mysql and ssh. You can close SSH choosing ‘exit’ button in file appears at the top-left most of SSH screen. Every command in mysql should be end with a semicolon (;) . MySQl is not case-sensitive for its command keywords; however, it is case sensitive for its variables. For ex: variables like Table name, Column Name etc are case sensitive. Whereas, keywords like SELECT, create etc are not case sensitive.


Download ppt "MySQL Working on Turing."

Similar presentations


Ads by Google