Dear All.
I'm writing a python script and register it as a hook, with context 'Whostmgr::Accounts::Create' and stage 'post'
Part of the script is :
1. cd to /home/['username']/public_html (in this case the username is 'gijilint')
2. Call : uapi --output=json --user=gijilint Mysql create_database name=gijilint_wp_20181008203558
3. Call : mysql -D gijilint_wp_20181008203558 <./master_sql.sql
The cpanel error log always got :
'''
[2018-10-08 20:35:59 -0400] info [uapi] ---debug_hooks---
[2018-10-08 20:35:59 -0400] info [uapi] msg: No hooks found for traversed context
[2018-10-08 20:35:59 -0400] info [uapi] context: Cpanel::UAPI::Mysql::create_database
[2018-10-08 20:35:59 -0400] info [uapi] stage: post
ERROR 1049 (42000): Unknown database '<./master_sql.sql'
'''
I tried to go to mysql shell and call : show databases , and 'gijilint_wp_20181008203558' is there
exit from mysql shell back to bash shell, I manualy call 'mysql -D gijilint_wp_20181008203558 <./master_sql.sql' and got no error messages.
Login back to mysql shell , (using 'mysql -D gijilint_wp_20181008203558') and call 'show tables' ... and all the tables is created as expected.
My question is : why step #3 got 'ERROR 1049 (42000): Unknown database '<./master_sql.sql' ?
Sincerely
-bino-
I'm writing a python script and register it as a hook, with context 'Whostmgr::Accounts::Create' and stage 'post'
Part of the script is :
1. cd to /home/['username']/public_html (in this case the username is 'gijilint')
2. Call : uapi --output=json --user=gijilint Mysql create_database name=gijilint_wp_20181008203558
3. Call : mysql -D gijilint_wp_20181008203558 <./master_sql.sql
The cpanel error log always got :
'''
[2018-10-08 20:35:59 -0400] info [uapi] ---debug_hooks---
[2018-10-08 20:35:59 -0400] info [uapi] msg: No hooks found for traversed context
[2018-10-08 20:35:59 -0400] info [uapi] context: Cpanel::UAPI::Mysql::create_database
[2018-10-08 20:35:59 -0400] info [uapi] stage: post
ERROR 1049 (42000): Unknown database '<./master_sql.sql'
'''
I tried to go to mysql shell and call : show databases , and 'gijilint_wp_20181008203558' is there
exit from mysql shell back to bash shell, I manualy call 'mysql -D gijilint_wp_20181008203558 <./master_sql.sql' and got no error messages.
Login back to mysql shell , (using 'mysql -D gijilint_wp_20181008203558') and call 'show tables' ... and all the tables is created as expected.
My question is : why step #3 got 'ERROR 1049 (42000): Unknown database '<./master_sql.sql' ?
Sincerely
-bino-