Saya akan mulai dengan beberapa kode kesalahan, karena saya telah menggunakan MySQL dan menemukan kesalahan yang telah saya dokumentasikan. Kadang-kadang masih teranggap ok saja di sebahagian besar waktu, vendor dapat menggunakan kode kesalahan yang benar-benar umum.Sebetulnya saya telah melihat beberapa vendor yang benar-benar memasukkan “generik” pada definisi kode kesalahan atau keluarannya. Seperti kebanyakan lingkungan TI beberapa masalah / kesalahan ditangani tergantung di konfigurasi Sahabat. Inilah sebabnya kenapa saya suka mendokumentasikan kode kesalahan yang saya lihat dan apa maksudnya kepada lingkungan saya.
I/O error 2013
Terlihat pada replikasi, terjadi ketika master tak terjangkau oleh budak. Restart budak menggunakan svcadm bagi menghapus.
- ERROR 1206 (HY000) The total number of locks exceeds the lock table size
- Using InnoDB storage engine – MySQL is trying to tell you that it doesn’t have enough room to store all of the row locks that it would need to execute your query. To fix it, adjust innodb_buffer_pool_size and restart MySQL. By default, this is set to 8MB, which is too small for anyone who is using InnoDB to do anything. Pengaturan goes in my.cnf file.
- ERROR! The server quit without updating PID file (Seen when starting, something is a miss with the server)
- Try removing the hostname.err file from the data directory
- Try running the mysqlhome/scripts/mysql_install_db script this will reload the mysql tables (have not tested yet to see what happens to data tables)
- Fetching tables hangs
- Using MySQL workbench, tables show as fetching but never return (hang). This is usually caused by a table which is from a lower version of MySQL or just after an upgrade is performed. Run the /usr/local/mysql/bin/mysql_upgrade script to upgrade tables.
- Nagios monitoring errors
- Check to ensure updated script /usr/local/nagios/libexec/check_mysql_status.sh is in place, the path must contain /usr/local/mysql/bin or it will not find mysql command.
- check to ensure it has the correct ownership of naigos with group of nagios
- make sure the output file /tmp/mysql_check.tmp is also owned by nagios – if not remove it and the script will recreate it
- Replication see ERROR 1396 (drop user non exist)
- log into mysql on slave and issue following commands
- stop slave
- set global sql_slave_skip_counter = 1
- start slave
- show slave status G (output should show clean replication)
Saya merasa bermanfaat bagi mempunyai tabel kalender di database. Tak memakan banyak ruang atau mempengaruhi performa. Ini benar-benar bermanfaat apabila Sahabat perlu mengatur hari-hari istimewa selaku hari libur bagi area atau perusahaan tertentu. Sahabat dapat menggunakannya apabila Sahabat perlu menjalankan join di sesuatu di mana tanggal dilibatkan dan format tabel yang Sahabat gunakan berbeda dari yang Sahabat butuhkan. Saya tahu Sahabat dapat menyesuaikan format petunjuk SQL tapi terkadang lebih gampang bagi menarik dari tabel yang terdapat.
- Create calendar table (example shows one date column from 2009-01-01 thru 2031-12-31)
- use SchemaName;
- truncate table TableName;
- drop table ints;
- CREATE TABLE ints ( i tinyint );
- INSERT INTO ints VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
- INSERT INTO ALL_DATES (AD_date)
- SELECT date(‘2009-01-01’) + interval a.i*10000 + b.i*1000 + c.i*100 + d.i*10 + e.i day
- FROM ints a JOIN ints b JOIN ints c JOIN ints d JOIN ints e
- WHERE (a.i*10000 + b.i*1000 + c.i*100 + d.i*10 + e.i) <= 8399
- ORDER BY 1;
Bagi pembahasan berikutnya akan di lanjutkan di part kedua. Semoga bermanfaat.
sumber :kursuswebprogramming.com/blog/