KELOLA DATABASE MYSQL DI TERMINAL UBUNTU
1. Insert
SQL="insert into table(fieldname)values('value')";
2. Update
SQL="update tablename set fieldname='value';
3. Delete
SQL="delete tablename";
4. Select
SQL="select * tabel";
5. Sql-mode
# nano /etc/MySql/mysqld/file
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
6. Count rows
mysql_num_rows
7. optimalisasi
php.ini
default_socket_timeout = 60000000
8. mengganti password
mysql -u root -p{Provide your root password here}
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Provide your root password here');
FLUSH PRIVILEGES;
exit;
Tidak ada komentar:
Posting Komentar