![]() |
Get Database Server Hostname from azure SQL Server - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html) +--- Forum: Installation and Upgrades Support (https://community.mybb.com/forum-182.html) +--- Thread: Get Database Server Hostname from azure SQL Server (/thread-191068.html) |
Get Database Server Hostname from azure SQL Server - ibragh - 2016-04-10 Hello everyone , I have an azure sql server with a sql database inside it. when I start installing MyBB forum i need to complete the database configuration. So, how can i know my database server hostname. I tried all possible options for server name and the database and the user.. and i always get this error. Quote:Error maybe my input is wrong. how can i be sure of these record Quote:Database Server Hostname: This is how i get my Database server host name and the other records I tried these and it is wrong. I tried many things.. how can i know ? Ask me anything i will answer it. Thank you RE: Get Database Server Hostname from azure SQL Server - Donald_Duck - 2016-04-10 Try: "localhost" without quotes as host name or go to mysql database and check for hostname corresponding to database username RE: Get Database Server Hostname from azure SQL Server - ibragh - 2016-04-10 (2016-04-10, 07:28 PM)Donald_Duck Wrote: Try: "localhost" without quotes as host name didn't work (2016-04-10, 07:28 PM)Donald_Duck Wrote: or If you mean the mysql database on the sql server. nothing clearly said that this is hostname or database username. that is why I am asking. Thank you Donald_Duck for responding. -There is a DB connection string but it provides the same info i used before! I will copy the PHP string If you can find anything useful in it: Quote:Server: MyserverName.database.windows.net,1433 \r\nSQL Database: MyDatabase\r\nUser Name: MyUserName\r\n\r\nPHP Data Objects(PDO) Sample Code:\r\n\r\ntry {\r\n $conn = new PDO ( \"sqlsrv:server = tcp:MyserverName.database.windows.net,1433; Database = MyDatabase\", \"MyUserName\", \"{your_password_here}\");\r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n}\r\ncatch ( PDOException $e ) {\r\n print( \"Error connecting to SQL Server.\" );\r\n die(print_r($e));\r\n}\r\n\rSQL Server Extension Sample Code:\r\n\r\n$connectionInfo = array(\"UID\" => \"MyUserName@MyserverName\", \"pwd\" => \"{your_password_here}\", \"Database\" => \"MyDatabase\", \"LoginTimeout\" => 30, \"Encrypt\" => 1, \"TrustServerCertificate\" => 0);\r\n$serverName = \"tcp:MyserverName.database.windows.net,1433\";\r\n$conn = sqlsrv_connect($serverName, $connectionInfo); Text with red color i changed it RE: Get Database Server Hostname from azure SQL Server - Donald_Duck - 2016-04-10 You got two possible options now: First, open support ticket on your host asking the DB hostname Second, you can PM me TeamViewer ID so i can check remotely and try find your DB host name. Alternatively, wait for some skilled member / staff to reply on this with direct possible solution EDIT: Most likely it seem's to be "Server: MyserverName.database.windows.net" Or try creating anyfile.php and copy this code in it: visit anyfile.php file from browser, if you get "Please try later" then DB details wrong, trying playing with it by trying different hostname,username,password.. until you get "Success." message displayed Copy " anyfile.php " to root directory RE: Get Database Server Hostname from azure SQL Server - Nathan Malcolm - 2016-04-10 ...are you sure that's MySQL? I have no experience with Azure but that doesn't look like a MySQL server. RE: Get Database Server Hostname from azure SQL Server - Euan T - 2016-04-10 Hi, You need to ensure the database is a MySQL database, as per this guide: https://azure.microsoft.com/en-us/documentation/articles/store-php-create-mysql-database/ The standard Azure "SQL Database" will not work. RE: Get Database Server Hostname from azure SQL Server - ibragh - 2016-04-10 Thank you Donald_Duck for the help. It is exactly what Nathan Malcolm and Euan T said. SQL Database won't work. |