Jump to content

lakshitha

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by lakshitha

  1. Try to connect again adding "port" argument like this,

    conn2 = mysql.connector.connect(host="localhost", user="root", passwd="12345", database="empl", port="#PORT")

    Otherwise,

    Go to localhost sever using browser and make sure about that password is correct. Or make a new account (with password or without) and try to execute your queries via command line with database.

  2. Exactly, You used an unexpected character after \ (backslash) in your python file.

    Please, can you publish your code here? If you are , I can give the best solution.

  3. Hi Lara,

    If you want to print illegal something in Python, you should use escape character.

    >>> print("I am using \" illegal \" something.")
    I am using " illegal " something.

    else if you want to print two backslashes (\\) in string, you must use r before string.

    >>> print(r"This will insert two \\ (backslashes)")
    This will insert two \\ (backslashes)

     

×
×
  • Create New...