get_account.cjs 1021 B

123456789101112131415161718192021222324252627282930313233343536
  1. const mysql = require('mysql2/promise');
  2. async function main() {
  3. const conn = await mysql.createConnection({
  4. host: '8.136.223.156',
  5. port: 6630,
  6. user: 'media_manager',
  7. password: 'media_manager',
  8. database: 'media_manager'
  9. });
  10. // 查询表结构
  11. const [columns] = await conn.query(`SHOW COLUMNS FROM platform_accounts`);
  12. console.log('=== platform_accounts 表结构 ===');
  13. columns.forEach(col => console.log(` ${col.Field}: ${col.Type}`));
  14. // 查询账号 24 的信息
  15. const [accounts] = await conn.query(`
  16. SELECT * FROM platform_accounts WHERE id = 24
  17. `);
  18. console.log('\n=== 账号 24 信息 ===');
  19. if (accounts.length > 0) {
  20. const acc = accounts[0];
  21. Object.keys(acc).forEach(key => {
  22. if (key === 'cookies' || key === 'cookie') {
  23. console.log(`${key}: ${acc[key] ? '(长度: ' + acc[key].length + ')' : 'null'}`);
  24. } else {
  25. console.log(`${key}: ${acc[key]}`);
  26. }
  27. });
  28. }
  29. await conn.end();
  30. }
  31. main().catch(console.error);