To copy with indexes and triggers do these 2 queries:
CREATE TABLE newtable LIKE oldtable; INSERT INTO newtable SELECT * FROM oldtable;
To copy just structure and data use this one:
CREATE TABLE tbl_new AS SELECT * FROM tbl_old;
To copy with indexes and triggers do these 2 queries:
CREATE TABLE newtable LIKE oldtable; INSERT INTO newtable SELECT * FROM oldtable;
To copy just structure and data use this one:
CREATE TABLE tbl_new AS SELECT * FROM tbl_old;
ALTER TABLE `tablename` ADD `lock` int(5) NOT NULL, ADD `created_at` date DEFAULT NULL, ADD `created_by` int(11) NOT NULL DEFAULT 0, ADD `deleted_by` int(11) NOT NULL DEFAULT 0, ADD `deleted_at` date DEFAULT NULL, ADD `updated_at` date DEFAULT NULL, ADD `updated_by` int(11) NOT NULL DEFAULT 0 AFTER branch_status;
Magento Set the File permission (you need to be root/ sudo)
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; && sudo chown -R www-data:www-data . && sudo chmod u+x bin/magento With the path: cd /var/www/html/magento2 && find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento
echo < pre >; var_dump($query->createCommand()->sql); echo < /pre >;
To add a foreign key (grade_id) to an existing table (users), follow the following steps:
ALTER TABLE users ADD grade_id SMALLINT UNSIGNED NOT NULL DEFAULT 0; ALTER TABLE users ADD CONSTRAINT fk_grade_id FOREIGN KEY (grade_id) REFERENCES grades(id);
php -v
Shows:
PHP 5.6.25-2+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologiescode
In the page the php code phpinfo();
phpinfo();
Shows:
PHP Version 5.5.9-1ubuntu4.19
Now to correct this you need to:
sudo a2dismod php5 sudo a2enmod php5.6 sudo service apache2 restart
Cheers
Find here the PHP script, just upload.
Prompt for password:
mysql -u username -p databasename < filename.sql
Enter password directly (not secure):
mysql -u username -pPlainPassword databasename filename.sql
Example:
mysql -u root -p wp_users < wp_users.sql mysql -u root -pPassword123 wp_users --default-character-set=utf8 < wp_users.sql
See also:
4.5.1.5. Executing SQL Statements from a Text File
jQuery(document).ready(function($){ if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { $(".main-navigation li:has(ul) > a").bind('touchstart',function(e){ e.stopPropagation(); e.preventDefault(); if($(this).hasClass("oneTouch")){ $(this).removeClass("oneTouch"); window.location = $(this).attr("href"); } else{ $(this).addClass("oneTouch"); } }); } });
$('#myCarousel.carousel[data-type="multi"] .item').each(function(){ $('#myCarousel.carousel[data-type="multi"] .item').removeClass('active').eq(Math.floor((Math.random() * $('#myCarousel.carousel[data-type="multi"] .item').length))).addClass("active"); var next = $(this).next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); for (var i=0;i<4;i++) { next=next.next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); } });