Initial Commit
Commit pertama, memindahkan repository dari github ke gitea.
This commit is contained in:
commit
13a47fbebf
41 files changed
+12327
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import mysql from 'mysql2/promise';
|
||||
|
||||
async function main() {
|
||||
console.log('Connecting to MySQL at 103.155.224.244...');
|
||||
try {
|
||||
const connection = await mysql.createConnection({
|
||||
host: '103.155.224.244',
|
||||
user: 'root',
|
||||
password: 'hqn9OY2pJx1oYRYJoVrC0Q64sZj8k3W3ZpoVcsKAmv1DFqO9u0DIMGCkjjXEjLaB',
|
||||
connectTimeout: 10000,
|
||||
});
|
||||
|
||||
console.log('Connected successfully!');
|
||||
const [rows] = await connection.query('SHOW DATABASES;');
|
||||
console.log('Databases:', rows);
|
||||
|
||||
// Create database if not exists
|
||||
await connection.query('CREATE DATABASE IF NOT EXISTS aghatis_studio_db;');
|
||||
console.log('Database aghatis_studio_db checked/created.');
|
||||
|
||||
await connection.end();
|
||||
} catch (err) {
|
||||
console.error('Connection failed:', err.message);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in new issue
Block a user