Revision of Working with Databases from Mon, 06/01/2009 - 15:43

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Command-line commands for common tasks. (http://www.pantz.org/software/mysql/mysqlcommands.html)

List Databases
show databases;
Create a database

/usr/local/mysql/bin/mysqladmin -u <username> -p create <databasename>

Create a user for a database
Login to the MySQL server:

/usr/local/mysql/bin/mysql -u <username> -p

Create the user and grant them privileges:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, INDEX,  CREATE
TEMPORARY TABLES, LOCK TABLES
ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Export a database

/usr/local/mysql/bin/mysqldump -u username -p database_name > FILE.sql

Import a database

/usr/local/mysql/bin/mysql -u username -p database_name < FILE.sql

Recent Updates

  • 11 months 1 week ago
    1.27.2 update
  • 11 months 3 weeks ago
    Drupal 10/11 config
  • 11 months 3 weeks ago
  • PHP
    11 months 3 weeks ago
    PHP 8.3.11 and AlmaLinux
  • 11 months 3 weeks ago
    New version of Pound
Error | Production Monkeys

Error

The website encountered an unexpected error. Please try again later.