Two ways to work with MySQL

A command-line client

First you need to use the steps in my Useful Tips item about "Setting Up Your MySQL Account". Then type mysql at the Unix prompt.

[gerlanjr@bscacad3 ~]> mysql
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21391
Server version: 5.7.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, 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> select * from products1;
+----+----------+-----------------------+-------+
| id | sku      | name                  | price |
+----+----------+-----------------------+-------+
|  1 | TY232278 | AquaSmooth Toothpaste |  2.25 |
|  2 | PO988932 | HeadsFree Shampoo     |  3.99 |
|  3 | ZP457321 | Painless Aftershave   |  4.50 |
|  4 | KL334899 | WhiskerWrecker Razors |  4.17 |
+----+----------+-----------------------+-------+
4 rows in set (0.01 sec)

mysql> exit
Bye
[gerlanjr@bscacad3 ~]>

A web-based client

phpMyAdmin

See https://bscacad3.buffalostate.edu/~gerlanjr/phpMyAdmin/
(use your Buff Satte Username. Your MySQL password is yur banner ID beginning with a CAPITAL B.

How to import and run a SQL script that creates a database

How to review the data and structure of a table

How to run SQL commands

How to create users with limited privileges

This will only work on tour local MySQL database.

GRANT ALL PRIVILEGES ON database-name.* TO 'userid'@'%' IDENTIFIED BY 'user=db-password';

Back