(May-09-2019, 07:32 AM)srm Wrote: It does not even go upto this line it stops at very first line of connection...is it becos there is also sql server 2012 installed on same machine which also takes first instance as localhost???not getting it...
(May-08-2019, 09:59 AM)srm Wrote: ok sir,when I tried the above mention code..there is no error or result..output is blank.
so, which of your two statements is correct?
both your databases are on localhost, just listen on different port
import pymysql conn=pymysql.connect('localhost','root','mcse@123','mysqldb') print("Connection Succeeded") cmd=conn.cursor() cmd.execute('create table emp(empid int,empname char(10))') cmd.execute("insert into emp values(111,'asha')") cmd.commit() cmd.execute('select * from emp') result=cmd.fetchall() for row in result: print(row) conn.close()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs