Installing Oracle Database 11g Express Edition

Desired Outcome:

Installation of Oracle’s Database, which maybe premature considering I’ve just installed MariaDB. Hopefully, I can have both systems running at the same time. Strategically good to learn Oracle first.

This is the main web-site for information and downloads:

This is the main site for documentation:

This is the readme info for documentation:
Note: Nothing much of importance

This is the Installation Guide for Linux:

MariaDB – Admin – Primer1 – Intro

This is the index for the Primer
XREF to:

Basic overview of this intro-level primer into access the mysql prompts and modifying a database

Note: I have everything they’re needing for the primer — functioning MariaDB system

When I run (logged in as root): mysql -u root -p
This happens: Access denied for user ‘root’@’localhost’ (using password: YES)
Note: I don’t get why I now cannot load the MariaDB console
Answer: When I was entering the password, I was entering the root password and not for the MariaDB

MariaDB [(none)]>
Note: This tell me that the MariaDB monitor is running without a database loaded

Various commands to learn in MariaDB:

MariaDB – Admin – Troubleshooting server start issues

XREF to:

Q: How to track events by looking at the logs? Where are they stored?
A: Named “host-name.err” and written to the data directory
Note: In my case, I didn’t see specific files like that, but did see useful files to review
-yum.log; messages-20151120, etc

Q: How do you search for the error logs, if they’re not where you think they would be?
A: mysqld –help –verbose | grep ‘datadir’ | tail -1 (Note: In my case a plug-in wasn’t working)

Q: What is the my.cnf file?
A: Contains configuration settings, ie where data directory is

Note: Important at some point to figure out how to configure my.cnf to set up the basedir, etc

MariaDB – Admin – mysqladmin

mysqladmin is used to run commands against mysqld daemon

XREF to this doc for info:
XREF to this MariaDB doc:

Q: How to check if MySQL Process is running?
A: ps aux | grep mysql
mysql 9555 0.0 7.2 774240 133436 ? Ssl 14:17 0:02 /usr/sbin/mysq d
paul 9713 0.0 0.2 162420 4212 pts/0 T 15:02 0:00 mysql -u root -p
root 9812 0.0 0.0 112640 964 pts/0 S+ 15:29 0:00 grep –color=auto mysql
Note: ERROR! MySQL is running but PID file could not be found

Q: Logged in as root, is mysqladmin running?
A: mysqladmin status
Note: mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@’localhost’ (using password: NO)’
Note: Issue is that syntax requires authentication

Q: How to check mysqladmin running?
A: mysqladmin -u root -p status (Note: Enter password I have for database system)
Uptime: 4748 Threads: 2 Questions: 27 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 11 Queries per second avg: 0.005

Q: As an experiment, stop the SQL service, check for mysqladmin running, start the service again
A: sudo systemctl stop mariadb.service
A: mysqladmin -u root -p status
Note: mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2 “No such file or directory”)’
Check that mysqld is running and that the socket: ‘/var/lib/mysql/mysql.sock’ exists!
A: sudo systemctl start mariadb.service
A: mysqladmin -u root -p status
Note: Uptime: 7 Threads: 1 Questions: 1 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 11 Queries per second avg: 0.142
Summary: Output of “mysqladmin status” will give a definite answer on whether the MySQL service is running.

Q: How to check status of mysql service (because I’m using CentOS)
A: service mysql status
Note: ERROR! MySQL is running but PID file could not be found
Note: Instructions within here to fix this:

Q: What is the PID file that it was referring to?

Q: What happens when I enter: mysqladmin -u root -p (and enter the database system password)?
mysqladmin Ver 9.1 Distrib 10.1.8-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] command command….

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf
The following groups are read: mysqladmin client client-server client-mariadb
The following options may be given as the first argument:
–print-defaults Print the program argument list and exit.
–no-defaults Don’t read default options from any option file.
–defaults-file=# Only read default options from the given file #.
–defaults-extra-file=# Read this file after the global files are read.

-c, –count=# Number of iterations to make. This works with -i
(–sleep) only.
–debug-check Check memory and open file usage at exit.
–debug-info Print some debug info at exit.
-f, –force Don’t ask for confirmation on drop database; with
multiple commands, continue even if an error occurs.
-C, –compress Use compression in server/client protocol.
Directory for character set files.
Set the default character set.
-?, –help Display this help and exit.
-h, –host=name Connect to host.
-b, –no-beep Turn off beep on error.
-p, –password[=name]
Password to use when connecting to server. If password is
not given it’s asked from the tty.
-P, –port=# Port number to use for connection or 0 for default to, in
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/services, built-in default (3306).
–protocol=name The protocol to use for connection (tcp, socket, pipe,
-r, –relative Show difference between current and previous values when
used with -i. Currently only works with extended-status.
-s, –silent Silently exit if one can’t connect to server.
-S, –socket=name The socket file to use for connection.
-i, –sleep=# Execute commands repeatedly with a sleep between.
–ssl Enable SSL for connection (automatically enabled with
other flags).
–ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
–ssl-capath=name CA directory (check OpenSSL docs, implies –ssl).
–ssl-cert=name X509 cert in PEM format (implies –ssl).
–ssl-cipher=name SSL cipher to use (implies –ssl).
–ssl-key=name X509 key in PEM format (implies –ssl).
–ssl-crl=name Certificate revocation list (implies –ssl).
–ssl-crlpath=name Certificate revocation list path (implies –ssl).
Verify server’s “Common Name” in its cert against
hostname used when connecting. This option is disabled by
-u, –user=name User for login if not current user.
-v, –verbose Write more information.
-V, –version Output version information and exit.
-E, –vertical Print output vertically. Is similar to –relative, but
prints output vertically.
-w, –wait[=#] Wait and retry if connection is down.
–plugin-dir=name Directory for client-side plugins.
–default-auth=name Default authentication client-side plugin to use.

Variables (–variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
——————————— —————————————-
count 0
debug-check FALSE
debug-info FALSE
force FALSE
compress FALSE
character-sets-dir (No default value)
default-character-set auto
host (No default value)
no-beep FALSE
port 0
relative FALSE
socket (No default value)
sleep 0
ssl-ca (No default value)
ssl-capath (No default value)
ssl-cert (No default value)
ssl-cipher (No default value)
ssl-key (No default value)
ssl-crl (No default value)
ssl-crlpath (No default value)
ssl-verify-server-cert FALSE
user root
verbose FALSE
vertical FALSE
connect-timeout 43200
shutdown-timeout 3600
plugin-dir (No default value)
default-auth (No default value)

Where command is a one or more of: (Commands may be shortened)
create databasename Create a new database
debug Instruct server to write debug information to log
drop databasename Delete a database and all its tables
extended-status Gives an extended status message from the server
flush-all-statistics Flush all statistics tables
flush-all-status Flush status and statistics
flush-client-statistics Flush client statistics
flush-hosts Flush all cached hosts
flush-index-statistics Flush index statistics
flush-logs Flush all logs
flush-privileges Reload grant tables (same as reload)
flush-slow-log Flush slow query log
flush-status Clear status variables
flush-table-statistics Clear table statistics
flush-tables Flush all tables
flush-threads Flush the thread cache
flush-user-statistics Flush user statistics
kill id,id,… Kill mysql threads
password [new-password] Change old password to new-password in current format
old-password [new-password] Change old password to new-password in old format
ping Check if mysqld is alive
processlist Show list of active threads in server
reload Reload grant tables
refresh Flush all tables and close and open logfiles
shutdown Take server down
status Gives a short status message from the server
start-slave Start slave
stop-slave Stop slave
variables Prints variables available
version Get version info from server

Q: Why do I have to enter the password each time I run a mysqladmin command?
A: Because that’s the way it is
Note: mysqladmin -u root -p ping — responds with “mysqld is alive”, but I have to enter password each time

Q: What are some mysqladmin commands I can play with?

Q: How to change the password for root?
A: mysqladmin -u root -p123456 password ‘xyz123’
Note: p123456 was old password and xyz123 is new

Q: How to check if MariaDB/MySQL is running?
A: mysqladmin -u root -p ping
Note: Comes back with, “mysqld is alive”

Q: How to check which version of MariaDB is running?
A: mysqladmin -u root -p version
mysqladmin Ver 9.1 Distrib 10.1.8-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Server version 10.1.8-MariaDB
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 16 hours 46 min 1 sec
Threads: 1 Questions: 8 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 11 Queries per second avg: 0.000

Q: How to check status of server, so see threads?
A: mysqladmin -u root -p status
Uptime: 60501 Threads: 1 Questions: 9 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 11 Queries per second avg: 0.000

Q: How to check all the running processes?
A: mysqladmin -u root -p processlist
| Id | User | Host | db | Command | Time | State | Info | Progress |
| 19 | root | localhost | | Query | 0 | init | show processlist | 0.000 |

Q: How to create a database?
A: mysqladmin -u root -p create databasename

Q: How to show databases
A: First, go into MariaDB Monitor with – mysql -u root -p
A: show databases;
— +——————–+
| Database |
| information_schema |
| mysql |
| performance_schema |
| test |
4 rows in set (0.00 sec)

Q: How to Drop (AKA Delete, including all tables) a database? This should be done with caution as the data is destroyed.
A: mysqladmin -u root -p drop databasename

Q: How to shutdown MariaDB safely?
A: mysqladmin -u root -p shutdown

Q: Another way of how to shutdown MariaDB?
A: sudo systemctl stop mariadb.service

Q: How to start a server?
A: sudo systemctl start mariadb.service

Q: How to kill a sleeping process?
A: First, find the current processes with — mysqladmin -u root -p processlist
A: mysqladmin -u root -p kill 5,10
Note: The Process ID’s are 5 and 10 — if multiple processes you separate with a comma

Q: How to run multiple commands at same time?
A: mysqladmin -u root -p status version ping
Note: Put a space between each command

MariaDB – Admin – MySQL Query commands

Information about mysqladmin (administrative program for mysqld daemon)
XREF to:

Q: Where do you run mysql commands from?
A: From within the mysql monitor
Note: mysql -u root -p (Note: The password is what I set for the database system)
Note: I don’t think this is same as mysqladmin

Q: What are all commands from Help?
A: The following:
List of all MySQL commands:
Note that all text commands must be first on line and end with ‘;’
? (\?) Synonym for `help’.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don’t write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don’t show warnings after every statement.

Q: How to show all databases?
A: show databases;
information_schema |
| mysql |
| performance_schema |
| test

Compilation of interests, thoughts and musings…