How to dump a table from a database

# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql To dump a table from a MySQL database, you can use the mysqldump command-line tool. Here’s the basic syntax: bash mysqldump -u [username] -p [password] [database_name] [table_name] > [output_file.sql] Replace [username] with your MySQL username, [password] with your MySQL password, [database_name] with the name … Read more

How to dump one database for backup

# [mysql dir]/bin/mysqldump -u username -ppassword –databases databasename >/tmp/databasename.sql To dump a MySQL database for backup, you can use the mysqldump command. Here’s the basic syntax: bash mysqldump -u username -p database_name > backup_file.sql Replace username with your MySQL username, database_name with the name of the database you want to backup, and backup_file.sql with the … Read more

How to dump all databases for backup. Backup file is sqlcommands to recreate all db’s

# [mysql dir]/bin/mysqldump -u root -ppassword –opt >/tmp/alldatabases.sql To dump all databases in MySQL for backup, you can use the mysqldump command-line utility. Here’s the command: bash mysqldump -u username -p –all-databases > backup.sql Replace username with your MySQL username. When you run this command, it will prompt you to enter your MySQL password. After … Read more

How to Load a CSV file into a table

mysql> LOAD DATA INFILE ‘/tmp/filename.csv’ replace INTO TABLE [table name] FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘\n’ (field1,field2,field3); To load a CSV file into a table in MySQL, you can use the LOAD DATA INFILE statement. Here’s a basic example of how to do it: sql LOAD DATA INFILE ‘path_to_your_csv_file.csv’ INTO TABLE your_table_name FIELDS … Read more

How to make a column bigger and Delete unique from table

mysql> alter table [table name] modify [column name] VARCHAR(3); mysql> alter table [table name] drop index [colmn name]; To make a column bigger in MySQL, you can use the ALTER TABLE statement along with the MODIFY COLUMN clause. Here’s an example: sql ALTER TABLE your_table_name MODIFY COLUMN your_column_name new_data_type; Replace your_table_name with the name of … Read more