MySQL: Load data into table from file
The following piece of code shows how you can load data from a comma separated values file directly into a MySQL table:LOAD DATA LOCAL INFILE 'C:/documents/agenda.txt' IGNORE INTO TABLE agenda…
The following piece of code shows how you can load data from a comma separated values file directly into a MySQL table:LOAD DATA LOCAL INFILE 'C:/documents/agenda.txt' IGNORE INTO TABLE agenda…
The following code produces a sample function in MySQL: CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) DETERMINISTICRETURN CONCAT('Hello, ',s,'!');
The following code can be written in windows batch file (.bat): cd "D:\EasyPHP-5.3.3.1\mysql\bin>"D:\EasyPHP-5.3.3.1\mysql\bin>mysql -u root -p < c:\run_this_file.sql
mysql> show databases; MySQL Export:-------------mysqldump -u root -p --databases myschema > /var/www/html/myschema/backup_db/MySchema_20101228.sqlMySQL Import:-------------mysql -u root -p --database myschema < /home/nista/myschema_temp/MySchema_20101228_1458.sqlMySQL Export just the schema:------------------------------mysqldump -u root -p --no-data myschema >…
MySQL data types: CHAR( ) A fixed section from 0 to 255 characters long.VARCHAR( ) A variable section from 0 to 255 characters long.TINYTEXT A string with a maximum length…
How to create user and give the necessary grants:
create user 'ms'@'111.222.11.22' identified by 'swkb123';
grant select, delete, insert, update on myschema.* to 'ms'@'111.222.11.22'
grant all privileges on myschema.* to 'ms'@'111.222.11.22';
(more…)