| 123456789101112131415161718192021222324252627282930313233343536 |
- const mysql = require('mysql2/promise');
- async function main() {
- const conn = await mysql.createConnection({
- host: '8.136.223.156',
- port: 6630,
- user: 'media_manager',
- password: 'media_manager',
- database: 'media_manager'
- });
-
- // 查询表结构
- const [columns] = await conn.query(`SHOW COLUMNS FROM platform_accounts`);
- console.log('=== platform_accounts 表结构 ===');
- columns.forEach(col => console.log(` ${col.Field}: ${col.Type}`));
-
- // 查询账号 24 的信息
- const [accounts] = await conn.query(`
- SELECT * FROM platform_accounts WHERE id = 24
- `);
- console.log('\n=== 账号 24 信息 ===');
- if (accounts.length > 0) {
- const acc = accounts[0];
- Object.keys(acc).forEach(key => {
- if (key === 'cookies' || key === 'cookie') {
- console.log(`${key}: ${acc[key] ? '(长度: ' + acc[key].length + ')' : 'null'}`);
- } else {
- console.log(`${key}: ${acc[key]}`);
- }
- });
- }
-
- await conn.end();
- }
- main().catch(console.error);
|