11/05/2011

MySQL Tidbits

After installing mysql-server on Fedora 15:

# chkconfig mysqld on
# service mysqld start
# mysql_secure_installation

For the firewall, secure port 3306.

After starting the database server mysqld, it's now time to create a database, table, add data, and a user with full permissions using the client, mysql:
# mysql -u root -p
********
mysql> CREATE DATABASE mydb;
mysql> USE mydb;
mysql> CREATE TABLE questions (
> qid INT NOT NULL AUTO_INCREMENT,
> PRIMARY KEY(qid),
> question TEXT);
mysql> INSERT INTO questions VALUES (0,"Who created Linux?");
mysql> GRANT ALL ON mydb.* TO 'dbuser'@'localhost' IDENTIFIED BY 'password';

To backup a MySQL database, use the mysqldump command:

mysqldump -u root -p mydb > mydb.db

To restore a MySQL database, first drop the database, then create the database and use mysql to restore it:

mysql -u root -p

mysql> drop database mydb;
Query OK, 15 rows affected (1.85 sec)

mysql> create database mydb;
Query OK, 1 row affected (0.00 sec)

mysql> quit

mysql -u root -p mydb < mydb.db


https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords


11/02/2011

The Computer - A poem I wrote in 1984

The Computer
Central is the processor,
core of the complexity.
Peripherals are the sectors,
basic to the entity.
A soft touch, a character is read,
it’s image echos on the monitor bright.
A disk drive scratches its head,
for the data to read or write.
The transfer of information,
bytes and bits passed in a pulse.
A bit of logic improves calculation,
but life is not true or false.
The law of imperfection states:
that output to input is inferior.
Our dull duties are done at quicker rates,
so we can proceed to business superior.
The computer is our world altering,
but we are the ones who posed it.
Shrink away those who fear the evolving,
or be of the ones who profit.
Keith Wright
January 22, 1984

About Me - WrightRocket

My photo

I've worked with computers for over 30 years, programming, administering, using and building them from scratch.

I'm an instructor for technical computer courses, an editor and developer of training manuals, and an Android developer.