mysql -u whoever -p database_name_here < sql_file_here.sql
Category: mysql
By putting this on your mysql config file:
[mysqld]
innodb_buffer_pool_size = 2G
In dedicated db machines, you can set this to close to 80% of the available memory. This will avoid disk writes and speed up things in general.
The mysql configuration file is on :
/etc/my.cnf (usually)
Restaring mysql, and barabum barabim
The typical error message you get when this is too small is:
Mysql::Error: The total number of locks exceeds the lock table size:
This only means you did not configure that specific database to be compiled with php. For example, if you get that error when trying to connect to a mysql database, make sure that when you run ./configure (when installing php) you included the -with–mysql option.
INSERT INTO table_name (column1, column2, column3,…)
VALUES (value1, value2, value3,…)
ALTER TABLE [table_name] ADD COLUMN [clumn_name] timestamp with time zone;
MySQL example of how to delete a record
DELETE FROM [table_name] where [condition_column]=’blahblah’;
GRANT DELETE ON [table_name] TO [user_name];
MySQL example of dropping a column
ALTER TABLE pub_agreements DROP COLUMN registration_id;
MySQL example of updating a table
UPDATE [table] SET [column_name]=’whatever value’ WHERE name=’Channel AB’
MySQL example of how to create a table
CREATE TABLE films ( code char(5) CONSTRAINT firstkey PRIMARY KEY, title varchar(40) NOT NULL, did integer NOT NULL, date_prod date, kind varchar(10), len interval hour to minute, is_boolean boolean );