elasticsearch xampp magento 2.4

php bin/magento setup:install –base-url=”http://localhost/vifoznew/” –db-host=”localhost” –db-name=”vifoznew24″ –db-user=”root” –admin-firstname=”admin” –admin-lastname=”admin” –admin-email=”niravalldonetech@gmail.com” –admin-user=”admin” –admin-password=”Admin123″ –language=”en_US” –currency=”USD” –timezone=”America/Chicago” –use-rewrites=”1″ –backend-frontname=”admin” –search-engine=elasticsearch7 –elasticsearch-host=”localhost” –elasticsearch-port=9200

Importing MySQL Databases via SSH

Servers without a control panel (like cPanel or Plesk) don’t have phpMyAdmin installed. To manage databases without a control panel, you need to use the SSH command line to import .SQL backup files.

  1. Open the .SQL file in a text editor to ensure it is formatted to use the correct database. There should be a use database command at the top, and it should reference the database that is receiving the imported data. If this command is not included, you can add or use it once you log in to MySQL.
  2. Log in to SSH as the root user. If you do not know how to do this, see How do I access MySQL using SSH?
  3. To log in to MySQL, type mysql -u username -p, where username is your database username.
  4. When you see Enter password:, enter your password for that MySQL user.
  5. If you did not include the use database command in the .SQL file, select the target database of the import. Do this by typing use database_name; and then press Enter.
  6. Type SOURCE /path/to/sql/file.sql, and then press Enter.
  7. Monitor the running import log to check for errors.
  8. To confirm the data was imported correctly, type show tables; and then press Enter.
  9. Type select * from table; and then press Enter. Your imported MySQL database tables display.

Not able to load local file in WebView Nativescript Angular

your local file should be added in the webpack.config.js in the CopyWebpackPlugin section

From

new CopyWebpackPlugin([
{ from: { glob: “fonts/” } }, { from: { glob: “/.jpg” } }, { from: { glob: “/.png” } },
], { ignore: [${relative(appPath, appResourcesFullPath)}/**] }),

To

new CopyWebpackPlugin([
{ from: { glob: “/.html” } }, { from: { glob: “/.js” } },
{ from: { glob: “fonts/” } }, { from: { glob: “/.jpg” } }, { from: { glob: “/.png” } },
], { ignore: [${relative(appPath, appResourcesFullPath)}/**] }),

Magento 2.3: how to fix blank admin page not rendering windows

This is Magento bug. Wrong paths to Windows are generated. The fixed fix is

Magento 2.3.0

#/vendor/magento/framework/View/Element/Template/File/Validator.php:114

the string

$realPath = $this->fileDriver->getRealPath($path);

to replace

$realPath = str_replace(‘\’, ‘/’, $this->fileDriver->getRealPath($path));

Magento 2.2.7

/vendor/magento/framework/View/Element/Template/File/Validator.php:113

code

protected function isPathInDirectories($path, $directories)
{
    if (!is_array($directories)) {
        $directories = (array)$directories;
    }
    foreach ($directories as $directory) {
        if (0 === strpos($this->fileDriver->getRealPath($path), $directory)) {
            return true;
        }
    }
    return false;
}

to replace

protected function isPathInDirectories($path, $directories)
    {
        $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
        if (!is_array($directories)) {
            $directories = (array)$directories;
        }
        foreach ($directories as $directory) {
            if (0 === strpos($realPath, $directory)) {
                return true;
            }
        }
        return false;
    }

How to use custom query mysql in magento2

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
$resource = $objectManager->get(‘Magento\Framework\App\ResourceConnection’);
$connection = $resource->getConnection();
$tableName = $resource->getTableName(’employee’); //gives table name with prefix

//Select Data from table
$sql = “Select * FROM ” . $tableName;
$result = $connection->fetchAll($sql); // gives associated array, table fields as key in array.

//Delete Data from table
$sql = “Delete FROM ” . $tableName.” Where emp_id = 10″;
$connection->query($sql);

//Insert Data into table
$sql = “Insert Into ” . $tableName . ” (emp_id, emp_name, emp_code, emp_salary) Values (”,’XYZ’,’ABD20′,’50000′)”;
$connection->query($sql);

//Update Data into table
$sql = “Update ” . $tableName . “Set emp_salary = 20000 where emp_id = 12”;
$connection->query($sql);