c# - Move local mssql database to webhosted MYSQL -
c# - Move local mssql database to webhosted MYSQL -
i'm dektop developer , don't know much how webhosting work... please help me here.
currently app works mssql database installed locally on same machine. need go wider , allow multiple apps work same database on internet. have webhosting cpanel in , mysql database.
please tell me how can access tables in mysql database computers? select , update records in table. have implement functionality using php create such requests?
please advise..
exporting raw ms-sql dumps not work if seek import mysql because there differences in syntax. there commercial programs available help migrate data, otherwise might improve code php programme export mssql mysql.
but question sounds more you're asking how access databases remotely. . php can natively. when create link database specify host. example: $databaseconnection = new mysqli('username','password','host_ip_address');
if you're coming mssql may nail snares.
to allow remote connections on ms-sql utilize "surface area" configuration tool. you'll find mysql database server configured allow remote connections, if not you'll have take host (sounds don't have own box).
the next trick remember usernames in mysql this: 'user'@'host'.
cpanel hosting has phpmyadmin installed. open , @ user table in mysql database (the actual database named mysql running on mysql server).
you'll see host column. if 'root' user set 'localhost' won't able login user machine. wildcard symbol %. can read here - http://dev.mysql.com/doc/refman/5.5/en/adding-users.html
of course of study same rules apply mysql when comes users. don't utilize root business relationship access sub-databases, rather assign new users have required permissions. consider using non-predictable usernames. doesn't reply question (sorry) it's worth mentioning while you're looking @ user table.
so reply question: 1) login cpanel , create database 'foo'
2) run sql command:
grant privileges on foo.* 'secretuser'@'%' identified 'longpassword' then php code this:
$host = 'ipaddress or hostname'; $mysqli = new mysqli('secretuser','longpassword',$host,'foo'); // in php.net error handling $query = "select * tablename limit 0,10"; $result = $mysqli->query($query); the reason set limit there because you're used "select top 10"
c# php mysql desktop-application cpanel
Comments
Post a Comment