When I try the command  drush sql:sync @dev.dev @self or drush sql:sync @dev.dev @local it errors with:   Undefined class constant &amp;#039;MYSQL_ATTR_SSL_CA&amp;#039; in Drush\Sql\SqlMysql-&gt;creds() (line 60 of /Users/kevinquillen/Servers/foo/vendor/drush/drush/src/Sql/SqlMysql.php).  [error]  Drush command terminated abnormally due to an unrecoverable error. [5.47 sec, 7.92 MB]   [error]  Failed to import /tmp/foo_20180405_152230.sql.gz into target. [5.48 sec, 7.91 MB]   Previously, I could do drush sql-sync @source @destination and it worked just fine (from the host OS).  Not really sure where to go from here, I recently upgraded from Drush 8 to 9. The problem also happens on another project.  drush @local sql:connect -vvv works. A basic query with sql:query also works.  Why can't I sync from remote to local anymore after the upgrade?  Remote environment: Acquia Cloud  Local environment: DrupalVM  DrupalVM config.yml:  # Update the hostname to the local development environment hostname. vagrant_hostname: local.mysite.com vagrant_machine_name: mysite  # Set the IP address so it doesn't conflict with other Drupal VM instances. vagrant_ip: 0.0.0.0  # Use Ubuntu 16.04 LTS to match Acquia Cloud environments. vagrant_box: geerlingguy/ubuntu1604  # Set drupal_site_name to the project's human-readable name. drupal_site_name: "My Site"  # Provide the path to the project root to Vagrant. vagrant_synced_folders:   # Set the local_path for the first synced folder to `.`.   - local_path: .     # Set the destination to the Acquia Cloud subscription machine name.     destination: /var/www/mysite     type: nfs  drupal_build_composer_project: false # Toggling this to `true` would invoke `composer install` with the # projects own `composer.json` successfully. drupal_build_composer: false drupal_composer_path: false drupal_composer_install_dir: "/var/www/mysite" drupal_core_path: "/var/www/mysite/docroot" ssh_home: /var/www/mysite  drupal_db_user: drupal drupal_db_password: drupal drupal_db_name: drupal  # Set this to 'false' if you don't need to install drupal (using the drupal_* # settings below), but instead copy down a database (e.g. using drush sql-sync). drupal_install_site: false  # Drupal VM automatically creates a drush alias file in your ~/.drush folder if # this variable is 'true'. configure_drush_aliases: false  # This is required for front-end building tools. nodejs_version: "9.x" nodejs_npm_global_packages:   - name: bower   - name: gulp-cli   - name: yarn nodejs_install_npm_user: "{{ drupalvm_user }}" npm_config_prefix: "/home/{{ drupalvm_user }}/.npm-global" installed_extras:   #- adminer   - drupalconsole   - drush   - mailhog   - memcached   - nodejs   #- solr   #- selenium   - xdebug  # PHP 5.6 (PHP 7.1 is being tested, see: https://docs.acquia.com/node/25726). php_version: "7.1" php_install_recommends: no php_memory_limit: "256M" php_display_errors: "On" php_display_startup_errors: "On" php_realpath_cache_size: "1024K" php_sendmail_path: "/opt/mailhog/mhsendmail" php_opcache_enabled_in_ini: true php_opcache_memory_consumption: "192" php_opcache_max_accelerated_files: 4096 php_max_input_vars: "4000"  php_packages_extra:   - "php{{ php_version }}-bz2"   - "php{{ php_version }}-imagick"   - imagemagick  # XDebug configuration. # Change this value to 1 in order to enable xdebug by default. php_xdebug_default_enable: 1 php_xdebug_coverage_enable: 0 # Change this value to 1 in order to enable xdebug on the cli. php_xdebug_cli_enable: 0 php_xdebug_remote_enable: 1 php_xdebug_remote_connect_back: 1 # Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text. php_xdebug_idekey: PHPSTORM php_xdebug_max_nesting_level: 256 php_xdebug_remote_port: "9000"  post_provision_scripts:   - "../../../acquia/blt/scripts/drupal-vm/post-provision.php"
123782
I tried installing Drush with both methods listed in the drush.org documentation. I think they might be conflicting with each other if that's possible.   When I run composer global require drush/drush all the components appear to install correctly. However when I change to a Drupal site (Using XAMPP, /opt/lampp/htdocs/sitefolder) and run drush status I get the following error:      PHP Fatal error:  Undefined class constant 'MYSQL_ATTR_SSL_CA' in   phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php on line 56   Drush command terminated abnormally due to an unrecoverable error.   [error] Error: Undefined class constant 'MYSQL_ATTR_SSL_CA' in   phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php, line 56   I do have the following line in my ~/.bashrc:  export PATH="$HOME/.composer/vendor/bin:$PATH"  Unfortunately I don't know how to troubleshoot from here, as there doesn't seem to be an easy way to uninstall Drush via the main method (), which didn't seem to work for me. composer global remove drush/drush does appear to run successfully.  Thanks in advance.
23806
I've been using Drupal for several years, but only just dipping a toe in with Drush - I've bought an ebook tutorial and working my way through. I've installed Composer, and used it to install Drush. The tutorial book specified a particular build of Drush to install (7.0.0-alpha5). I've navigated to a drupal folder and run   drush st    to get installation info which works fine. The tutorial explains that you don't have to navigate into the drupal folder to do this, instead using  drush --root=PATH-TO-DRUPAL-SITE st   however this brings an error:   Fatal error: Call to undefined function conf_path()   Googling this error suggests this a problem with the version of Drush and to upgrade.  SO I've navigated into the .composer/vendor/drush/drush folder and run      composer global update but composer says nothing to update, confirming the version as 7.0.0-alpha5 - I assume this is not the latest 7.x version, so do I need something changing in the composer.json file?
112119
I am following the instructions to install Drush that are listed on this page:   I seem to be getting a syntax error within the code:  [user@localhost ~]$ wget https://github.com/drush-ops/drush/releases/download/8.0.0-rc4/drush.phar --2015-11-16 16:23:02--  https://github.com/drush-ops/drush/releases/download/8.0.0-rc4/drush.phar Resolving github.com (github.com)... 192.30.252.131 Connecting to github.com (github.com)|192.30.252.131|:443... connected. HTTP request sent, awaiting response... 302 Found 2015-11-16 16:23:05 (1.47 MB/s) - drush.phar saved [3496991/3496991]  [user@localhost ~]$ php drush.phar core-status  Parse error: syntax error, unexpected '[' in phar:///home/user/drush.phar/includes/output.inc on line 188   I am not seeing this error on Google. Any idea how to fix it?
109746
We're in the process of a server migration from an on-premise server (Win2008R2) to Azure PaaS.  To move the databases, we used the  tool, which worked great and we can connect to the migrated Azure DB via SQL Server Management Studio.  Considering:    Made quite a few changes to the migrated Azure database (tables, SPs, indexes) to work with the apps in Azure Combined multiple DBs from the on-prem server into one DB in Azure via DMA to save costs  One on-premise database is continually being modified by insert and update operations (multiple tables) during the migration process When fully switching hosting in Azure we need to make sure all data is up-to-date. This will be done very early in the AM during which on-prem IIS websites are stopped assuring no DB operations are made, giving us a short window to migrate missing data   Question: What is the best and fastest way to migrate data (all vs missing/updated) considering the above?  Can this be achieved by following the below steps?   Create a new empty Azure SQL database (to later hold all the tables of 5 on-prem databases) Via , migrate only the schema of that one on-prem database which is continually being modified by insert/update operations Via , set up auto data sync (e.g. every 30 minutes) between the on-prem and Azure database After data sync up and running, via - migrate schema and data of the rest of the on-prem databases (no data changes during migration process) into the single Azure database previously created and used for syncing   EDIT:  After enabling Data Sync in the Azure portal, the sync was unsuccessful due to the below logged errors:   Member Database: MyAzureDb -> Tombstone cleanup failed with the exception "SqlException Error Code: -2146232060 - SqlError Number:18456, Message: Login failed. Member Database: MyAzureDb -> Database provisioning failed with the exception "SqlException Error Code: -2146232060 - SqlError Number:18456, Message: Login failed.   To fix 1 and 2 above tried: ALTER ROLE DataSync_executor ADD MEMBER [myUser]; but got Cannot add the principal 'myUser', because it does not exist or you do not have permission.   Member Database:MyOnPremDb: -> Database provisioning failed with the exception "SqlException Error Code: -2146232060 - SqlError Number:325, Message: Incorrect syntax near 'MERGE'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the SET COMPATIBILITY_LEVEL option of ALTER DATABASE. SqlError Number:156, Message: Incorrect syntax near the keyword 'AS'.    The current compatibility level of the on-premise database is 80. Not sure what impact setting it to 100 will have to the production databse/apps.
46938
I am trying to execute my PHP code, which calls two MySQL queries via mysqli, and get the error "Commands out of sync; you can't run this command now".  Here is the code I am using  &lt;?php $con = mysqli_connect("localhost", "user", "password", "db"); if (!$con) {     echo "Can't connect to MySQL Server. Errorcode: %s\n". Mysqli_connect_error();     exit; } $con-&gt;query("SET NAMES 'utf8'"); $brand ="o"; $countQuery = "SELECT ARTICLE_NO FROM AUCTIONS WHERE upper(ARTICLE_NAME) LIKE % ? %"; if ($numRecords = $con-&gt;prepare($countQuery)) {     $numRecords-&gt;bind_param("s", $brand);     $numRecords-&gt;execute();     $data = $con-&gt;query($countQuery) or die(print_r($con-&gt;error));     $rowcount = $data-&gt;num_rows;     $rows = getRowsByArticleSearch("test", "Auctions", " ");     $last = ceil($rowcount/$page_rows); }  else {  print_r($con-&gt;error); } foreach ($rows as $row) {     $pk = $row['ARTICLE_NO'];     echo '&lt;tr&gt;' . "\n";     echo '&lt;td&gt;&lt;a href="#" onclick="updateByPk(\'Layer2\', \'' . $pk . '\')"&gt;'.$row['USERNAME'].'&lt;/a&gt;&lt;/td&gt;' . "\n";     echo '&lt;td&gt;&lt;a href="#" onclick="updateByPk(\'Layer2\', \'' . $pk . '\')"&gt;'.$row['shortDate'].'&lt;/a&gt;&lt;/td&gt;' . "\n";     echo '&lt;td&gt;&lt;a href="#" onclick="deleterec(\'Layer2\', \'' . $pk . '\')"&gt;DELETE RECORD&lt;/a&gt;&lt;/td&gt;' . "\n";     echo '&lt;/tr&gt;' . "\n"; } function getRowsByArticleSearch($searchString, $table, $max) {     $con = mysqli_connect("localhost", "user", "password", "db");     $recordsQuery = "SELECT ARTICLE_NO, USERNAME, ACCESSSTARTS, ARTICLE_NAME, date_format(str_to_date(ACCESSSTARTS, '%d/%m/%Y %k:%i:%s'), '%d %m %Y' ) AS shortDate FROM AUCTIONS WHERE upper(ARTICLE_NAME) LIKE '%?%' ORDER BY str_to_date(ACCESSSTARTS, '%d/%m/%Y %k:%i:%s')" . $max;     if ($getRecords = $con-&gt;prepare($recordsQuery)) {         $getRecords-&gt;bind_param("s", $searchString);         $getRecords-&gt;execute();         $getRecords-&gt;bind_result($ARTICLE_NO, $USERNAME, $ACCESSSTARTS, $ARTICLE_NAME, $shortDate);         while ($getRecords-&gt;fetch()) {             $result = $con-&gt;query($recordsQuery);             $rows = array();             while($row = $result-&gt;fetch_assoc()) {                 $rows[] = $row;             }             return $rows;         }     } }   I have tried reading up on this, but I am unsure of what to do. I have read about store result and free result, however these have made no difference when using them. I am unsure at exactly which point this error is being caused, and would like to know why it is being caused, and how to fix it.  Going by my debug statements, the first if loop for countQuery is not even being entered, because of an error in my sql syntax near near '% ? %'. However if I just select * instead of trying to limit based on a LIKE clause, I still get the command out of sync error.
51801
I have a production database called "master" that I want to replicate on another server under another name (call it "slave").   All worked fine until an ALTER TABLE statement was performed on the master server. Since then, the replication hung up and I get this error in the slave log:  [ERROR] Slave SQL: Error 'Table 'master.students' doesn't exist' on query. Default database: ''. Query: 'ALTER TABLE `master`.`students`   Well of course it does not exists since I told MySQL to rename "master" to "slave"! But it seems like MySQL decided not to rename the database in ALTER TABLE statements.  Here is an excerpt from my slave config.  server-id   = 2 relay-log   = /var/log/mysql/mysql-relay-bin.log log_bin     = /var/log/mysql/mysql-bin.log binlog_do_db   = slave replicate-rewrite-db="master-&gt;slave"
110483
I just moved to a new computer: Windows 10 with XAMPP. As far as I know I set everything up the same as it was on my old Windows 7 computer. But now, for some reason, much of the time when I run drush cc all or run update.php, the database gets corrupted. Most frequently, some cache tables' *.idb files (tablespaces) are deleted from my mysql directory, which makes those tables appear as "in use" in phpMyAdmin and prevents them from being edited or emptied. They are always cache tables and never tables that actually get modified by my update hooks. Restoring the database is the only way to fix it then. This is a mature site that I've been working on for a long time, and have never seen this until the new computer. What's happening here?  A sample error message when using update.php, caused by a missing *.idb file:  PDOException: SQLSTATE[HY000]: General error: 1812 Tablespace is missing for table '(null)': DELETE FROM {cache_field} WHERE (cid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] =&gt; field:message_type:6 ) in cache_clear_all() (line 168 of C:\&lt;path&gt;\includes\cache.inc).   My most recent drush cc all error message, which Google has never even heard of, was:  exception 'PDOException' with message 'SQLSTATE[HY000]: General      [error] error: 1030 Got error -1 "Internal error &lt; 0 (Not system error)" from storage engine InnoDB'
59879
I am running a fresh install of Linux Mint Nadia (14). I am following the instructions on Vagrant  but have gotten stuck on the . It seems the Vagrant box cannot connect outside and so I can't install anything using either Chef or Puppet.  In the basic Vagrant resolve.conf contains nameserver 10.0.2.3. But with that set I can't ping us.archive.ubuntu.com.  If I change it to 8.8.8.8 then I can ping us.archive.ubuntu.com but it does not stay set, and after a reboot it changes back to 10.0.2.3 - so provisioning fails again.  Ideally I would like for 10.0.2.3 to work on my setup. Failing that I would like a way to permanently change resolv.conf so that I can do provisioning.
96459
I'm trying to set up a cron job to run a PHP script daily as part of a web-based booking system. It's been running perfectly for several years on a different Apache server using this in the crontab:  0 3 * * * wget -q -O /dev/null http://www.my_other_domain.org.uk/scheduled/my_script.php   I've just installed the script on another Apache server, and it runs correctly when called through the browser.  However when I try to use cron, the cron daemon gives the message:  -: warning: setlocale: LC_ALL: cannot change locale (en_GB.utf-8) -: wget: command not found   When I tried  0 3 * * * /usr/bin/env wget -q -O /dev/null http://www.mydomain.org.uk/scheduled/my_script.php   I got the message:  -: warning: setlocale: LC_ALL: cannot change locale (en_GB.utf-8) -: /usr/bin/env: No such file or directory   Firstly, am I right in assuming that the setlocale warning is not relevant to the problem?  I've also tried   0 3 * * * /usr/bin/php /var/www/vhosts/mydomain/httpdocs/scheduled/my_script.php   which gives    -: /usr/bin/php: No such file or directory   I also tried putting a shebang as the first line of my script, and getting cron to call it using the full path.  The cron daemon reported that there was no such file or directory as /[full_path]/my_script.php .  Trying to use curl was no better.  I haven't got shell access to the server and I've been setting up the cron job through the Plesk control panel.  The cron job seems to be running as scheduled.  The system administrator did the following for me:  #which php /usr/bin/php  #which wget /usr/bin/wget  #which curl /usr/bin/curl   That seems to confirm that the commands are in the right location.  The above is an abbreviated history - I've lost count of the permutations and combinations I've tried, mostly as a result of reading advice in this and other forums.  Can anyone tell me why the cron job is unable to find the commands and suggest a solution?
101360
My configuration:     windows XP SP3 JDBC 2005 MS SQL Server 2008 Express, exposed via tcp/ip on port 1433 sqljdbc.jar in class path    I tried:  try {     Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();     con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433/SQLEXPRESS2008;databaseName=Test;selectMethod=cursor", "sa", ""); } catch (Exception e) {     e.printStackTrace(); }   But it always throws an exception:  java.sql.SQLException: No suitable driver   I also tried the following urls:  localhost:1433/SQLEXPRESS2008  localhost/SQLEXPRESS2008  localhost   Same results.  Any help?
93559
I installed drush using composer following the instructions here:   When trying to run drush cc all I get this error:     No Drupal site found, only 'drush' cache was cleared.[warning] 'all'   cache was cleared. [success]   I added this line:  export PATH="/Applications/MAMP/bin/php/php5.6.2/bin:$PATH"   to my .bash_profile and restarted bash and MAMP. Still no luck. Any ideas?   This is my drush status:   Drupal version         :  7.36                                                               Site URI               :  http://default                                                     Database driver        :  mysql                                                              Database hostname      :  localhost                                                          Database port          :                                                                     Database username      :  root                                                               Database name          :  srod                                                     PHP executable         :  /usr/bin/php                                                       PHP configuration      :                                                                     PHP OS                 :  Darwin                                                             Drush script           :  /Users/srod/.composer/vendor/drush/drush/drush.php   Drush version          :  7.0-dev                                                            Drush temp directory   :  /tmp                                                               Drush configuration    :                                                                     Drush alias files      :                                                                     Drupal root            :  /Applications/MAMP/htdocs/srodsite                             Site path              :  sites/default      I'm running it from Drupal project folder.
49413
My laptop has a small hard drive. I want to load a big data set. I have moved the entire /usr/local/var/postgres to the external hd, and symlinked it back. Now I'm getting this error,      psql: could not connect to server: Socket operation on non-socket     Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?   I have now found the problem.  Changing the default data directory causes Postgres to refuse connections to the server. The online Manual is a little [sic!] unspecific about "config files in the same directory"…  The solution I used (with psql) is to:            CREATE TABLESPACE tablespacename OWNER username LOCATION '/Path/to/Folder'   then,      CREATE DATABASE databasename OWNER username TABLESPACE tablespacename   and finally      psql databasename &lt; /Path/to/databasedump.sql   NOTE to future visitors of this question; please see the warning below from Craig Ringer regarding how to solve this problem properly.
123733
I mistakenly have source .bash_profile in the bashrc file and vice versa. Now when I tried to ssh into the machine (ec2), it will stuck at loading bash and get connection closed in a second. Is there a way I could fix it? Could I mount the disk to another ec2 instance to fix the bash files?  Update 1: I tried the following: %  ssh -i &quot;my-pem.pem&quot; -t ubuntu@&lt;server_address&gt;.amazonaws.com &quot;/bin/bash --noprofile --norc&quot; Connection to &lt;server_address&gt;.amazonaws.com closed.  Nothing else showed up. Do you have any idea on what was going wrong? For sanity check, if I do ssh -i &quot;my-pem.pem&quot;ubuntu@&lt;server_address&gt;.amazonaws.com, the message will be ...  28 packages can be updated. 0 of these updates are security updates. To see these additional updates run: apt list --upgradable  New release '20.04.2 LTS' available. Run 'do-release-upgrade' to upgrade to it.   Last login: Mon Feb 22 23:17:41 2021 from ip Connection to &lt;server_address&gt;.amazonaws.com closed.  Solution Just ssh onto the machine and immediately do Ctrlc and fix the bash files.
8763
I am running Drush version 6.2.0 and the latest Drupal 8 beta on Dreamhosters. When I run drush cc all within the sites directory, I receive the following error immediately after executing the command:     Fatal error: Class 'Drupal\Core\Session\AccountInterface' not found in        /home/mywebsite/mywebsite.com/core/includes/bootstrap.inc on line 63       Drush command terminated abnormally due to an unrecoverable error.                                                                                    Error: Class 'Drupal\Core\Session\AccountInterface' not found in       /home/mywebsite/mywebsite.com/core/includes/bootstrap.inc, line 63   Why does it happen? How can I fix this?
114963
I have a  that has been working since it moved there.  I did a git pull this morning, and am now getting errors:     $ drush      Warning: require(/home/mpd/drush/vendor/autoload.php): failed to open   stream: No such file or directory in   /home/mpd/drush/includes/bootstrap.inc on line 1007      Fatal error: require(): Failed opening required   '/home/mpd/drush/vendor/autoload.php' (include_path='.:') in   /home/mpd/drush/includes/bootstrap.inc on line 1007   How can I fix this?
16224
After much trial and tribulation, I thought I had drush all ready to roar. Much excitement. But then, no joy...  Drush is working. The sites operate fine via MAMP. Regardless, a "drush cc all" command returns:   No Drupal site found, only 'drush' cache was cleared.                                          [warning] 'all' cache was cleared.                                                                       [success]   This question has stumped drupalcon attendees and very experienced developers. Any ideas?  I am on Mac OS 10.9.3 using MAMP (free) Version 3.0.5  Here is my drush status:   Drupal version         :  7.29-dev                                 Site URI               :  http://default                           Database driver        :  mysql                                    Database hostname      :  localhost                                Database username      :  db_user                             Database name          :  db_name                        PHP executable         :  /usr/bin/php                             PHP configuration      :                                           PHP OS                 :  Darwin                                   Drush version          :  7.0-dev                                  Drush temp directory   :  /tmp                                     Drush configuration    :                                           Drush alias files      :                                           Drupal root            :  /Applications/MAMP/htdocs/mysite.dev   Site path              :  sites/default       Have tried executing drush from /Applications/MAMP/htdocs/mysite.dev; from /Applications/MAMP/htdocs/mysite.dev/sites/default; and using drush cc all --uri=http://localhost/mysite.dev  Tried running drush from sites/default. Same result.
55087
i am building a app which takes input from user and then search to a remote database(MySql).And then display the retrieved data on VisualForce page.One important note that my app will be distributable.  here is my controller class  public with sharing class Search  {    public String strTag {get;set;}   public String strlocation {get;set;}    public PageReference find() {              return null;   } }   Thanks in advance.  Updated  public with sharing class Search  {   public String strTag {get;set;} public String strlocation {get;set;}   public PageReference find() {             HttpRequest req = new HttpRequest();   HttpResponse res = new HttpResponse();   Http http = new Http();    req.setEndpoint('https://localhost/salesforce/');   req.setMethod('POST');     req.setCompressed(false);   req.setBody('key1=value1&amp;key2=value2');   req.setHeader('Content-Type', 'application/x-www-form-urlencoded');      try {     res = http.send(req);   } catch(System.CalloutException e) {     system.debug('Callout error: '+ e);   }   system.debug(res.getBody());      return null;  } }   I am getting below error now      error message System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = localhost/salesforce