1. Install ODBC Driver MariaDB MySQL (32 bits) for this case install mysql-connector-odbc-8.0.42-win32
mysql-connector-odbc-8.0.42-win32
mariadb-connector-odbc-3.2.6-win32
2. Setup DSN MariaDB Using MySQL Driver
# using mysql driver 32 >> pakai yang ini
Dsn=mysql321;Driver={MySQL ODBC 8.0 Unicode Driver};server=10.10.10.7;uid=admin;pwd=admin;database=erpdb;port=3306
# using maridb driver32
Dsn=maria;Driver={MariaDB ODBC 3.2 Driver};server=10.10.10.7;uid=admin;pwd=admin;database=erpdb;port=3306
3. change mariadb sql_mode
MariaDB [erpdb]> show tables like '%barang%';
Empty set (0.001 sec)
MariaDB [erpdb]> desc barang;
ERROR 1146 (42S02): Table 'erpdb.barang' doesn't exist
MariaDB [erpdb]> SELECT @@GLOBAL.sql_mode;
+-------------------+
| @@GLOBAL.sql_mode |
+-------------------+
| PIPES_AS_CONCAT |
+-------------------+
1 row in set (0.000 sec)
MariaDB [erpdb]> SET GLOBAL sql_mode='ANSI_QUOTES';
Query OK, 0 rows affected (0.000 sec)
MariaDB [erpdb]> SELECT @@GLOBAL.sql_mode;
+-------------------+
| @@GLOBAL.sql_mode |
+-------------------+
| ANSI_QUOTES |
+-------------------+
1 row in set (0.000 sec)
MariaDB [erpdb]>
4. create table in MariaDB
create table erpdb.barang(
KODE_BARANG char(6) not null ,
NAMA_BARANG varchar(25),
SATUAN_BARANG varchar(20),
STOK_BARANG decimal(4),
primary key (KODE_BARANG));
5. Export Wizard using Copy data from one or more tables or views
Use this option to copy all the data from the existing
create table erpdb.barang(
KODE_BARANG char(6) not null ,
NAMA_BARANG varchar(25),
SATUAN_BARANG varchar(20),
STOK_BARANG decimal(4),
primary key (KODE_BARANG));
6. Export Wizard using Write a query to specify the data to transfer
Use this option to write an SQL query to manipulate
select * from barang where kode_barang='ELK-06'
No comments:
Post a Comment