<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to append dataset to mysql server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524398#M142602</link>
    <description>&lt;P&gt;I am trying to upload data into an existing table in mysql database, using append. I am able to pull data from that table which means connection should be OK. Here is my code for data pulling with database information:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to mysql (server="thisistheserver.com" port=3311&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;user="username" password="mypassword");&lt;/P&gt;&lt;P&gt;create table&amp;nbsp;want as select * from connection to mysql&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;from&amp;nbsp;databaseschema.existingdata&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;disconnect from mysql;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now below is my code to append:&lt;/P&gt;&lt;P&gt;libname&amp;nbsp;DB mysql dsn = "&lt;SPAN&gt;thisistheserver.com&lt;/SPAN&gt;" schema=databaseschema port = 3311 uid = "username" password = "mypassword";&lt;BR /&gt;proc append base = DB.existingdata data =&amp;nbsp;have force;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns error: error trying to establish connection: can't connect to local mysql server&amp;nbsp;through socket&lt;BR /&gt;'/var/lib/mysql/mysql.sock' (2)&lt;/P&gt;&lt;P&gt;error: error in the libname statement.&lt;/P&gt;&lt;P&gt;error: libref DB is not assigned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me on this,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2019 22:30:20 GMT</pubDate>
    <dc:creator>leonzheng</dc:creator>
    <dc:date>2019-01-03T22:30:20Z</dc:date>
    <item>
      <title>how to append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524398#M142602</link>
      <description>&lt;P&gt;I am trying to upload data into an existing table in mysql database, using append. I am able to pull data from that table which means connection should be OK. Here is my code for data pulling with database information:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to mysql (server="thisistheserver.com" port=3311&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;user="username" password="mypassword");&lt;/P&gt;&lt;P&gt;create table&amp;nbsp;want as select * from connection to mysql&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;from&amp;nbsp;databaseschema.existingdata&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;disconnect from mysql;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now below is my code to append:&lt;/P&gt;&lt;P&gt;libname&amp;nbsp;DB mysql dsn = "&lt;SPAN&gt;thisistheserver.com&lt;/SPAN&gt;" schema=databaseschema port = 3311 uid = "username" password = "mypassword";&lt;BR /&gt;proc append base = DB.existingdata data =&amp;nbsp;have force;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns error: error trying to establish connection: can't connect to local mysql server&amp;nbsp;through socket&lt;BR /&gt;'/var/lib/mysql/mysql.sock' (2)&lt;/P&gt;&lt;P&gt;error: error in the libname statement.&lt;/P&gt;&lt;P&gt;error: libref DB is not assigned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me on this,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 22:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524398#M142602</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-03T22:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524404#M142603</link>
      <description>&lt;P&gt;Check you Libname Statement, The SAS/Access Libname to Mysql should be like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;libname mysqllib mysql user=username password=mypassword database=databaseschema  server=thisistheserver.com port=3311;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Jan 2019 22:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524404#M142603</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-01-03T22:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524407#M142606</link>
      <description>&lt;P&gt;Thanks, now it seems&amp;nbsp;libref is assigned and connection is established.&lt;/P&gt;&lt;P&gt;However, there is a new error in&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc append base = DB.existingdata data =&amp;nbsp;have force;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;error: no database selected SQL statement: SELECT * FROM 'existingdata'.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I used append locally before and there was never such an error be seen.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 22:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-append-dataset-to-mysql-server/m-p/524407#M142606</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-03T22:55:11Z</dc:date>
    </item>
  </channel>
</rss>

