Mysqli_querry Access Denied

I was successful in connecting to my database, on 000webhost, using the mysqli extension: $con=mysqli_connect(“localhost”,“id#######αααα",“αααααααααααα”,"id###### αααα”).
However, an attempt to run a query–$result = mysqli_query($con,$sql) or die($sql."

".mysqli_error($con))–on said database, in the same PHP script, returned the error: “…Access denied for user ‘id#######αααα’@’%’ to database 'id###### αααα”.’
“@’%” seemed to have been appended to the user id. I am at a lost to figure out the reason. Before the cPanel migration I used the mysql extension–I was alerted to the fact that the extension was deprecated, so I changed–and both the connection and the query worked.
I reviewed the tutorial “How to Connect to Database Using PHP”, How to Connect to Database Using PHP, and noted that it recommended using the PDO method to connect to MSQL but it did not discourage/disapprove using the mysqli method.
How do I correct this mysqli error?
Thanks,
Richard, Ogygian Hummers (http://ogygianhummers.comoj.com)

Hi @kenvant21!

Can you access your database through Database Manager?

I can access the database using the Database Manger with the id: id#######_αααα. However the Database Manger presents the id id#######_a5480026_αααα.

Hmm… This may be because your DB name contains special characters?

Terminate your database and create another one using characters from ASCII area.

Mysqli_querry Access Denied–Follow up
I terminated the database as you advised in your earlier post. I was able to note the correct User ID, id1626604_kenvant at https://databases.000webhost.com/ login. However, phpMyAdmin shows the User ID as id1626604_kenvant’@'2a02:4780:bad:c0de::13, see attached images. All of this before I had a chance to import the SQL database file.
After the database upload, the import process for the MySQL database file reports error: #1142 - CREATE VIEW command denied to user ‘id1626604_kenvant’@‘2a02:4780:bad:c0de::13’ for table ‘ID_Clade_Range’.
How do we proceed from here?
Thanks,
Richard, Ogygian Hummers (http://ogygianhummers.comoj.com)
NB. I was able to implement the database, without errors, on a local host, using XAMPP.

‘id1626604_kenvant’@'2a02:4780:bad:c0de::13`

id1626604_kenvant represents the database username

2a02:4780:bad:c0de::13 represents the database address

After the database upload, the import process for the MySQL database file reports error: #1142 - CREATE VIEW command denied to user ‘id1626604_kenvant’@‘2a02:4780:bad:c0de::13’ for table ‘ID_Clade_Range’.

Probably VIEW command has been restricted for security reasons. This issue can only be fixed by buying a paid plan or a VPS.

This topic was automatically closed after 25 days. New replies are no longer allowed.