|--- tells mysql to prompt for password
v
mysqladmin -u root -p password new_password
^
|--- keyword ensures encyption!
Ok, let's try it...
ldale@farheen:~$ mysqladmin -u root -p password i56890rgdhht2 Enter password:If all went well, you just get the terminal prompt back that you started with. That's a good thing.
mysqladmin: [Warning] Using a password on the command line interface can be insecure. Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
history
history -c
history
mysql -u root -p
after you hit return you'll be prompted for the password. Use your NEW one, this time.
ldale@farheen:~$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 45 Server version: 5.6.19-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2014, 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>
If you get the mysql> prompt, all has gone well!
If changes don't seem to take effect, sometimes a reload command going thru mysqladmin is required. Type the following and hit return. Then try to login again as above.
mysqladmin -u root -p reload
show databases;
use mysql
show tables;
select * from user;
CREATE DATABASE aliens;
USE aliens;
You can cut-n-paste or download the content of these files into your directory.
To "run" them, login into mysql, use the proper database. Then type "source create.sql" and hit return. Do the same with the others.
Or delete a whole database with
drop database aliens;
SELECT, select, SeLeCtall mean the same thing!
So for us, in the Linux Lab, ASSUME CASE-SENSITIVE
SELECT * FROM abductee; SELECT * FROM AbduCTEE;are NOT AT ALL the same thing!
SELECT lname,fname
FROM abductee;
SELECT fname,lname
FROM abductee;
SELECT lname AS 'Last Name',fname
FROM abductee;
SELECT fname, numTrips
FROM abductee
WHERE numTrips > 30;
SELECT fname
FROM abductee
WHERE 20 < numTrips AND numTrips < 50;
Note. A select should have only one(uno,1) WHERE clause. If you have more than one condition you must build the appropriate BOOLEAN EXPRESSION.
20 < numTrips AND numTrips < 50
20 < numTrips && numTrips < 50
DELETE FROM abductee
WHERE lName="Dale";