ld: library not found for -lzstd while bundle install for mysql2 gem Ruby on macOS Big Sur 11.4 Apple M1

Step 1: confirm you have both openssl and MySQL installed via brew brew install mysql brew install openssl or if you have previous version of openssl try brew reinstall openssl@3 Step 2: Run this on your Rails app to make sure you can get through bundler: gem install mysql2 -v ‘0.5.3’ — –with-opt-dir=$(brew –prefix openssl) … Read more

Describe all tables in the database in a single statement?

There is no statement that describe all tables at once. Here’s some options: SELECT * FROM information_schema.columns WHERE table_schema=”db_name”; SELECT * FROM information_schema.columns WHERE table_schema=”db_name” ORDER BY TABLE_NAME, ORDINAL_POSITION; SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, COLUMN_TYPE, COLUMN_COMMENT, ORDINAL_POSITION FROM information_schema.columns WHERE table_schema=”db_name” ORDER BY TABLE_NAME, ORDINAL_POSITION; SELECT * FROM information_schema.columns WHERE table_schema != ‘information_schema’;

Take perfect backup with mysqldump

If you want to take a full backup i.e., all databases, procedures, routines, and events without interrupting any connections: mysqldump -u [username] -p -A -R -E –triggers –single-transaction > full_backup.sql -A For all databases (you can also use –all-databases) -R For all routines (stored procedures & triggers) -E For all events –single-transaction Without locking the … Read more

Export MySQL database with triggers and procedures?

mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior: –routines – FALSE by default –triggers – TRUE by default so in mysqldump command , add –routines like : mysqldump <other mysqldump options> –routines > outputfile.sql See the MySQL documentation about mysqldump arguments.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)